Skip to content
Blog

The CSS You Learned Is No Longer All There Is to CSS

If you learned CSS more than five years ago, you’ve missed a revolution. The limitations you once accepted as inherent to the language no longer exist.

Development3 min read
AlejandroChief Technology Officer

The CSS You Learned Is No Longer All There Is to CSS

If you learned CSS more than five years ago, you’ve missed a revolution. The limitations you once accepted as inherent to the language no longer exist.

The browser can now handle tasks that previously required libraries, preprocessors, or JavaScript.

Container Queries

For years, we requested the ability to style components based on their container rather than the viewport. That capability now exists.

A card component can reorganize itself when its container is narrow, regardless of overall screen size. This fundamentally changes how we approach responsive design.

You no longer design for screens. You design truly modular components that adapt to wherever they live.

The :has() Selector

The parent selector CSS never had. You can now select an element based on its children or sibling elements.

A form can change styles if it contains an input with an error. A card can adjust its layout depending on whether it includes an image. No extra classes or JavaScript required.

Cascade Layers

CSS’s cascade has always been powerful but difficult to manage. Cascade layers let you organize styles into explicit layers with clear precedence.

You can ensure component styles always override utility styles, or give theme overrides priority over base styles—without specificity wars.

Subgrid

CSS Grid was revolutionary, yet children of a grid item could not align with the parent grid’s lines. Subgrid solves this limitation.

You can now create nested layouts where every element aligns perfectly with the main grid. What once required complex workarounds is now a single declaration.

Mature CSS Variables

Custom properties have been available for years, but their practical use has matured. They are no longer limited to colors and sizes.

You can use them to control animation states, configure components, and build complete design systems without preprocessors.

The Cost of Not Updating

Writing CSS the way you did in 2018 still works. However, you’re writing more code than necessary, relying on tools that are no longer required, and building fragile solutions where robust native options now exist.

Modern CSS is not only more powerful—it is more maintainable. Less code achieves the same results, and that code expresses intent more clearly.

Browser Compatibility

Most of these features enjoy broad support. Container queries, :has(), and cascade layers are available in all modern browsers.

The argument “I can’t use it because of IE” ended years ago. If your project targets browsers from the past two years, you can safely adopt nearly all of these features.

Keep reading

Related articles

Development

The Code Slowing Down Your Website Isn't the One You Wrote

Third-party scripts are, on most of the websites we audit, the biggest source of slowness. Not the framework, not the images, not the server: the code you load from other domains. Analytics, support chat, advertising ...

Development

The Language That Machines Actually Understand

Structured data is the most direct way to explain to a machine what your page contains. A human reads “Different Growth, web development agency, rated 4.9 out of 5” and understands it instantly. A search engine, howev...

Next step

Do you have a project in mind?

If this article was useful and you want to know how we can help, we are here to listen.