From Sass to CSS: The Full Circle Story (@layer)

📧 help me improve it.

How the web grew up, and so did I.

There was a time when writing vanilla CSS felt like building a house with a spoon.

No variables, no nesting, no structure.

Just globals, overrides, and crossed fingers.

In 2015 I even wrote an article titled “Embracing Sass: Why You Should Stop Using Vanilla CSS.”:


Read: https://www.toptal.com/front-end/embracing-sass-why-you-should-stop-using-vanilla-css


And honestly? I was right back then. CSS was a mess. Sass rescued us.

2015…Fast-forward to 2025.

CSS looks at Sass like a teenager who finally outgrew their training wheels and wonders why the helmet was so big.

We now have cascade layers, native variables, container queries, nesting — real solutions to real problems.

The language ate the preprocessor’s lunch and then asked for dessert.

The Death of @import and the Rise of @layer

Before, @import was a necessary evil.

It gave us modularity when CSS didn’t have a real concept of it.

It let us break our styles into manageable pieces — at the cost of performance and maintainability.

Every @import triggered a blocking request, delaying rendering.

You could feel the browser tapping its foot waiting for styles to load, one by one.

It worked… but it sucked.

@layer changed the rules.

We now have:

@layer reset, base, components, utilities, overrides;

This single line gives us something preprocessors always struggled to provide:

✅ Predictable cascade order
✅ Architecture you control, not accidental overrides
✅ Clarity about which parts of the system win

And the best part?
We can still import files — without surrendering control:

@import url("styles/base.css") layer(base);
@import url("styles/buttons.css") layer(components);

Same modular benefits.
None of the old chaos.

@layer turns CSS into categories the browser respects.
@import layer() turns the cascade into design — not guessing.

Sass had to invent partials and naming conventions just to simulate this idea.
CSS now ships with it built-in.

The cascade finally grew a backbone.

×