Modern CSS

 
Styled Components What is CSS Modules?

Modern CSS

Modern CSS Picture

CSS is strangely considered both one of the easiest and one of the hardest languages to learn as a web developer. It's certainly easy enough to get started with it - you define style properties and values to apply to specific elements, and that's pretty much all you need to get going! However, it gets tangled and complicated to organize CSS in a meaningful way for larger projects. Changing any line of CSS to style an element on one page often leads to unintended changes for elements on other pages.

In order to deal with the inherent complexity of CSS, all sorts of different best practices have been established. The problem is that there isn't any strong consensus on which best practices are in fact the best, and many of them seem to completely contradict each other. If you're trying to learn CSS for the first time, this can be disorienting to say the least.

The goal of this article is to provide a historical context of how CSS approaches and tooling have evolved to what they are today in 2018. By understanding this history, it will be easier to understand each approach and how to use them to your benefit.

Styled Components

Styled-components is a CSS-in-JS library that enables you to write regular CSS and attach it to JavaScript components. With styled-components, you can use the CSS you're already familiar with instead of having to learn a new styling structure.

Continue Reading →

What is CSS Modules?

CSS files in which all class names and animation names are scoped locally by default.

Continue Reading →