freakingeek / howtowritecssin2022

How to write CSS in 2022

Home Page:https://www.figma.com/proto/EjU882jNTCSJunt9cLF4rC/How-to-write-css-in-2022?node-id=62%3A181&scaling=contain&page-id=0%3A1

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

How to write CSS in 2022

To write CSS correctly, you need to know it better first, let's get a little more familiar with CSS and take a closer look at some of it's problems.


  • Not Scalable Syntax
  • Bad Browser Support
  • Unused CSS Classes
  • No Test at All

Now what, can we fix them?

Yes, CSS may have problems, but all of these are easily solvable


Not Scalable Syntax

Why not? You can always scale your CSS using methods like BEM and OOCSS.


Bad Browser Support

Unfortunately, different browsers still have different understandings of CSS commands, but that's not a problem! Using a tool like PostCSS this problem can also be solved!


Unused CSS Classes

Increasing or decreasing the project features creates a list of unused styles, but it is not a problem because with PurgeCSS these additional styles are specified and removed from the project bundle.


No Test at All

Well not exactly, you can unit test CSS using a tool called Barista, but it's not as popular as other methods.


Let's Push our skills to the next level!

You can easily upgrade your CSS skills using the following tools/technologies


  • JSS ( eg. Styled Components )
  • CSS Modules/Scoped
  • CSS Frameworks