Strictness options
#14665
Replies: 1 comment
-
Thinking about this a bit more - postcss plugins can output warnings, which can be dealt with by postcss-reporter and dealt with however it needs. Kind of live-blogging my explorations here so excuse the ignorance - in a PoC, I reported warnings when tailwind tried to fetch a theme key, but it was reporting warnings for candidates such as |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
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