You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
First off, thank you all for all your incredible work on Tailwind. Really excited for v4! 🎉
I'm looking for functionality that would help build-tool authors validate classname lists. Specifically, I'd love a way to programmatically verify that a list of classnames is valid according to the Tailwind config (or css file). This would provide similar benefits to type-checking:
Catch typos early via enhanced tooling in the LSP and compiler/bundler.
Make refactoring safer
In terms of implementation, I imagine this could take a few forms.
A Tailwind CLI subcommand (probably easiest for me to integrate)
JS/Rust-based APIs, which is probably best for VSCode LSP integrations
My specific use-case is somewhat unique - we collect all classnames in our project for safelisting. However, I think this functionality could benefit the broader ecosystem, especially around IDE integration. There would be challenges for others to integrate this as there could be classname strings with both tailwind and non-tailwind classes. A potential solution for those that want this functionality is to mark tailwind classes via either a prefix ("tw-p-4 tw-flex"), identity function (tw("p-4 flex")), or some other way.
Let me know if y'all think something like this is reasonable and/or if this already exists and I missed it.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
👋 Hi all,
First off, thank you all for all your incredible work on Tailwind. Really excited for v4! 🎉
I'm looking for functionality that would help build-tool authors validate classname lists. Specifically, I'd love a way to programmatically verify that a list of classnames is valid according to the Tailwind config (or css file). This would provide similar benefits to type-checking:
In terms of implementation, I imagine this could take a few forms.
My specific use-case is somewhat unique - we collect all classnames in our project for safelisting. However, I think this functionality could benefit the broader ecosystem, especially around IDE integration. There would be challenges for others to integrate this as there could be classname strings with both tailwind and non-tailwind classes. A potential solution for those that want this functionality is to mark tailwind classes via either a prefix (
"tw-p-4 tw-flex"
), identity function (tw("p-4 flex")
), or some other way.Let me know if y'all think something like this is reasonable and/or if this already exists and I missed it.
Thank you for your consideration,
Jake
Beta Was this translation helpful? Give feedback.
All reactions