dylanirlbeck / tailwind-ppx

A Reason/OCaml Pre-Processor eXtension (PPX) that validates your Tailwind classes at compile-time.
MIT License
152 stars 15 forks source link

Idea: Add underscore at the beginning to dissable a class easily #137

Open d4h0 opened 3 years ago

d4h0 commented 3 years ago

Hi,

Something I often use with "vanilla Tailwind" is to prefix a class with an underscore to disable it temporarily.

For example this:

<div class="text-red">...</div>

becomes this:

<div class="_text-red">...</div>

At the moment, this is handles like an error. What I propose, is to treat this special case as a warning (a warning would still be useful, so these classes don't end up in production). This would be similar to how we use an underscore-prefix to disable warnings about unused variables.

dylanirlbeck commented 3 years ago

Hey @d4h0, this is an interesting feature request. I personally haven't done this during development in JS, for instance, but I can see the use case pretty clearly: It would speed up development for the same reasons that prefixing unused variables with an underscore causes less headache.

I don't know when/if I'll get around to implementing this feature, though it seems fairly trivial. If anyone who sees this is interested in taking it on, do follow up on this issue. I'm thinking that the scope/dev work would roughly look like this:

I'm open to suggestions from others! Thanks again for the idea.