How should I access a specific utility to render the class name? #2451
-
I'm working an open-source converter to convert any normal html to tailwind (basically it tries to detect and apply the right classes when possible). When I work on width for example and detect that it is a "full" width, I need to produce the class name w-full. Is there an easy way to do this instead of hardcoding all prefix? Thank you. |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments
-
hello again. I wonder if this is possible or should I go ahead hard-coding everything? |
Beta Was this translation helpful? Give feedback.
-
No built in way to look this up I'm afraid. Your best bet is to probably use PostCSS to parse Tailwind's output and build your own data structure you can use to find the classes you need 👍🏻 |
Beta Was this translation helpful? Give feedback.
-
Thank you @adamwathan. |
Beta Was this translation helpful? Give feedback.
No built in way to look this up I'm afraid. Your best bet is to probably use PostCSS to parse Tailwind's output and build your own data structure you can use to find the classes you need 👍🏻