haitam
TTCTheo's Typesafe Cult
•Created by haitam on 1/11/2024 in #questions
what is the correct way to use prefix in tailwindcss
i'm working on a plugin for a certain application, that allows for custom css and whatever.
i'm trying to isolate all my css from the other plugins, for isolation purposes
i tried using the prefix in the config, but imo it makes it unreadable.
But it looks ugly and unreadablei was thinking of making my own little function that sits in between classname and my actual css like
clsx
so it will identify tailwindcss classes and adds the prefix to it
and it will look like this
the function is in the utils and have access to the tailwind config and prefixok now the problems... 1- I don't have a function that is exposed from the tailwind library that allows me to identify tailwind classes (not sure) 2- tailwind wont recognize the classes and build them because it doesn't find ex
plug-tg-flex
it found flex
(maybe there is a hack for it? idk)
PORS:
- you don't have to change your entire codebase just to change the prefix
- readable code
CONS:
- every classname will need to be wrapped in the csx function, for consistancy4 replies
TTCTheo's Typesafe Cult
•Created by haitam on 12/27/2023 in #questions
next auth v5 i'm getting a `invalid_grant`
when i use google provider
here's my auth code
3 replies
TTCTheo's Typesafe Cult
•Created by haitam on 7/29/2023 in #questions
stop using prefix with tailwindcss
Yes, just DO NOT USE PREFIX WITH TAILWIND, unless you have a really good reason to
it makes your components not useable, for people who just want to use them.
or if you want to make it a component and use it in another project, it will add unnecessary extra steps.
i found out that some people use prefix, from the nextra project
i was trying to import it to be used in app directory with some special tools, and i had to fork the entire project and theme just to change that
nx-
prefix
it was devastating,
and no, i'm not gonna use their prefix, because i also have my components that doesn't use it, so i just decided to fix their issue
at last I made it all work.
The point is reusability and ease of forking.3 replies
TTCTheo's Typesafe Cult
•Created by haitam on 5/12/2023 in #questions
How do you self host your projects in a vps
without relying on any cpanel or vercel,
i have a vps and i usually move the project using git and run yarn build then yarn start
i also sat up a systemd service that handles keeping that website running
so my process of upgrading the site would be to ssh into it and then run yarn build
but after some testing, i found out that while the build is running, i can't access the website, and or if the build fails the website breaks.
i saw something in the vercel cli where it builds it then if the build is successful it outputs it into "out" folder
then it runs it from there.
is there a way to do that without involving needing vercel
36 replies