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
Tailwind is great - thank you for all the work you guys do in maintaining it.
For a recent enterprise project, there's been an issue with theming safety and creating a guarded system where the application build will fail if it's trying to build with a missing theme colour. Looking through the code, it seems clear we are parsing tailwind classes and skipping over bad matches, but what would it look like if there was an option for example @strict, where candidates matched to a tailwind background utility would console.warn in development and throw new Error in production/CI? Is this something that has been explored previously?
Some issues for this could be integrating other styling libraries, which is a pretty significant tradeoff, but it seems tailwind's pattern matching algorithms are pretty well guarded and by the time we're finding a theme key's value we're sure it's a tailwind class regardless - implementing a strict mode here should have minimal interference to other styling libraries.
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
-
Hey all,
Tailwind is great - thank you for all the work you guys do in maintaining it.
For a recent enterprise project, there's been an issue with theming safety and creating a guarded system where the application build will fail if it's trying to build with a missing theme colour. Looking through the code, it seems clear we are parsing tailwind classes and skipping over bad matches, but what would it look like if there was an option for example
@strict
, where candidates matched to a tailwind background utility wouldconsole.warn
in development andthrow new Error
in production/CI? Is this something that has been explored previously?Some issues for this could be integrating other styling libraries, which is a pretty significant tradeoff, but it seems tailwind's pattern matching algorithms are pretty well guarded and by the time we're finding a theme key's value we're sure it's a tailwind class regardless - implementing a strict mode here should have minimal interference to other styling libraries.
Would be great to hear what people think.
Beta Was this translation helpful? Give feedback.
All reactions