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 consistancy1 Reply
i also thought of having a vscode plugin that hides the prefix
or make it look smaller ... or as a capsule