1.

How to create a practical, maintainable CSS

Answer»

Below are the best practices to be followed to create a practical and maintainable CSS.

  • Think in terms of components, not pages.
  • Think about types of things, not INDIVIDUAL things.
  • Prefer classes to IDs.
  • Create composable classes.
  • Use descendent selectors to avoid REDUNDANT classes.
  • Keep the selectors as short as possible.
  • Order the CSS rules loosely by specificity.
  • Prefer percentages for INTERNAL layout DIMENSIONS.


Discussion

No Comment Found