Introduction of disabling/ignoring variants #18895
                  
                    
                      rozsazoltan
                    
                  
                
                  started this conversation in
                Ideas
              
            Replies: 0 comments
  
    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.
Uh oh!
There was an error while loading. Please reload this page.
-
TL;DR: New
@disable-variantor@ignore-variantdirective.Problem
Currently, there's no proper way to revoke built-in variants. For example, a
light:variant provided by an external plugin cannot be ignored, so the styles it introduces become part of theoutput.css, even if I try to make the variant rule ignored using@custom-variant, e.g.,:not(*).The same issue occurs with the built-in
darkvariant if I personally don't need it. For instance, I might want to ship the smallest possible CSS, so I don't need a separate dark mode. Even if I don't use thedark:variant myself, UI packages do, which means dark variant references end up in theoutput.css- even if I manually disable the dark variant.input.css
index.html
And
output.csswill not ignoredark:bg-black; it will be included inoutput.csseven though I don't want it.Idea
There should be an option, either inside
@custom-variant, to disable specific variants.Or a directive like
@disable-variant(or maybe@ignore-variant?), which, regardless of any previous instructions, permanently prevents any styles associated with that variant from being included in theoutput.cssif it appears even once.input.css
index.html
And
output.csswould only include bg-white; thedark:bg-blackis ignored due to the disable.Beta Was this translation helpful? Give feedback.
All reactions