I just watched this great talk on #css Cascading Layers presented by @mia. A lot of good stuff in there. Thank you!
https://www.youtube.com/watch?v=4PkhzoFLJ0Q
I borrow couple of thoughts:
I just watched this great talk on #css Cascading Layers presented by @mia. A lot of good stuff in there. Thank you!
https://www.youtube.com/watch?v=4PkhzoFLJ0Q
I borrow couple of thoughts:
> If your tools don't let you use the platform, that's not a tool. That's an obstacle.
This is so strong. Finger-pointing at CSS-in-JS libraries and Tailwind. Although, it can be told in many other areas.
I always incline to use vanilla CSS whenever possible (based on the context, of course). But I also used Tailwind-mostly as an utility CSS, which with Cascading Layers, would be used in the "highest" layer.
> The best selectors don't need naming conventions.
Right, got it. Selector combinations (not sure if this is the correct statement) are much more powerful and with Cascading Layers naming conventions loose their utility.
I am a big proponent of BEM naming convention, I like its simplicity yet straightforwardness of resolving specificity issues. When done right.
I'm looking forward to adopting layers instead of relying on BEM-which, despite its few naming rules, I've often seen misused.
And, of course, this one, which is a complete shift in my thinking about `!important` declaration.
It is not about overriding previous styles, so the current declaration wins. It's about protecting it from being overridden! Use layers for prioritization and `!important` for protection.