bytepursuits@programming.dev to Web Development@programming.devEnglish · 4 months agoDo you already use @layer in your code?developer.mozilla.orgexternal-linkmessage-square2fedilinkarrow-up114arrow-down10file-text
arrow-up114arrow-down1external-linkDo you already use @layer in your code?developer.mozilla.orgbytepursuits@programming.dev to Web Development@programming.devEnglish · 4 months agomessage-square2fedilinkfile-text
Do you guys already use css @layer in your code? just curious. Do you deem a level of adoption sufficient? https://caniuse.com/mdn-css_at-rules_layer
minus-squarefalseWhite@programming.devlinkfedilinkarrow-up2arrow-down1·edit-24 months agoHaven’t found a use case for it yet. If you’ve used it, please give me some examples of how you used it to solve a styling problem that otherwise would have been difficult or messy with other css rules.
minus-squarebytepursuits@programming.devOPlinkfedilinkarrow-up1·edit-24 months agoI think it really helps if you dont like !important: @layer base, toggles; @layer toggles { .wprm-print-hide-recipe-nutrition .wprm-recipe-nutrition-label-section { display: none; } } instead of .wprm-print-hide-recipe-nutrition .wprm-recipe-nutrition-label-section { display: none !important; } I guess I answered my own question - I think its a neat feature and ill use it.
Haven’t found a use case for it yet.
If you’ve used it, please give me some examples of how you used it to solve a styling problem that otherwise would have been difficult or messy with other css rules.
I think it really helps if you dont like !important:
@layer base, toggles; @layer toggles { .wprm-print-hide-recipe-nutrition .wprm-recipe-nutrition-label-section { display: none; } }instead of
.wprm-print-hide-recipe-nutrition .wprm-recipe-nutrition-label-section { display: none !important; }I guess I answered my own question - I think its a neat feature and ill use it.