Work in progress
Strategies
This page reviews the various strategies you can apply to tackle CSS, tracing their strengths and weaknesses, and comparing them against one another.
- Stylesheets
Stylesheets
Methodologies
Methodologies organize your CSS as the size of your website or web application grows. They're adopted to create a regular way of writing CSS rules and applying them in HTML.
- BEM, a method to create reusable components via consistent naming and structure
- CubeCSS, an extension of CSS that embraces the cascade and inheritance
- rscss, a set of simple ideas to guide your process of building maintainable CSS
Units
Various units are useful for different manipulations in CSS. Here's a simple chart breaking down when to use what. There are three values:
- Y - Yes, use this unit for this purpose!
- N - No, avoid this unit for this purpose.
- / - It's a mixed bag and sometimes you'll need this unit for this purpose.
Purpose | px | em | rem | % | vh/vw |
position | Y | N | N | Y | Y |
margin | N | Y | Y | N | N |
padding | / | Y | Y | N | N |
border | Y | N | N | N | N |
shadows | Y | N | N | N | N |
font size | N | Y | Y | N | N |
small layouts | N | N | N | Y | / |
large layouts | N | N | N | / | Y |