When writing CSS, we have to carefully think about how we write and structure our code. Without any proper “plan of attack” the Cascade can suddenly work against us, and we might end up with pieces of code overwriting each other, selectors getting heavier and heavier, a few !important modifiers here and there, … — Uhoh!
To regain control over the Cascade in those situations there’s a new CSS language feature to help us: Cascade Layers (CSS @layer).
Let’s take a look at what these Layers are, how we can use them, where they fit in, and what benefits they bring.
Bramus Van Damme
Bramus Van Damme is a web developer from Belgium. From the moment he discovered view-source at the age of 14 (way back in 1997), he fell in love with the web and has been tinkering with it ever since.
With his company 3RDS he works as a freelance frontend developer. Although he defaults to HTML, CSS, and JavaScript (in that order), the current frontend frameworks (React, …) and build tools are no strangers to him.