Hover '22

Cascade Layers

About this presentation

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.