/
Separate concerns with CSS rules

Separate concerns with CSS rules

I think this is another key design concept to apply. Rather than mixing concerns with CSS I think it’s worth exploring the idea of separating classes based on what concern we are targeting. These are what I think of as separate concerns:

  • Layout

    • Positioning of elements

  • Appearance

    • Color

    • Shadow and curved corner effects

    • Borders

It’s also key to keep CSS rules very flat - avoid using nested CSS rules etc. since it makes it difficult to manage them.

Related content

Use Namespaces for CSS
Use Namespaces for CSS
More like this
How do you make an AJAX call?
How do you make an AJAX call?
Read with this
CSS Positioning - use the grid.
CSS Positioning - use the grid.
More like this
How do use a CSS grid to layout a form nicely?
How do use a CSS grid to layout a form nicely?
Read with this
How can we find simplicity in CSS?
How can we find simplicity in CSS?
More like this
CSS Selectors
CSS Selectors
Read with this