Back to Home
Engineering
The Evolution of CSS Architecture
From BEM to Tailwind, exploring how we style the web and what the future holds for CSS.
Introduction
CSS has come a long way since its inception. We’ve moved from simple stylesheets to complex preprocessors, and now to utility-first frameworks like Tailwind CSS.
The BEM Era
Block Element Modifier (BEM) was a methodology that helped us organize our CSS classes. It was verbose but effective.
.block__element--modifier {
color: red;
}
The Rise of CSS-in-JS
With React, we saw the rise of CSS-in-JS libraries like Styled Components and Emotion. These allowed us to scope our styles to components.
Utility-First CSS
Tailwind CSS changed the game by providing a set of utility classes that could be composed to build complex UIs.
Conclusion
The future of CSS is bright, with new features like Container Queries and CSS Nesting making their way into browsers.