Skip to content

Instantly share code, notes, and snippets.

View VienDinhCom's full-sized avatar
🎯
Focusing

Viễn Đinh VienDinhCom

🎯
Focusing
View GitHub Profile
@maxhoffmann
maxhoffmann / component-based-css-architecture.md
Last active June 23, 2024 01:57
Component based CSS Architecture

Component based CSS Architecture

Rules

  1. A component always consists of CSS and HTML (JS is optional)
  2. HTML and JS of a component are located in ComponentName.js
  3. Styles of a component are located in ComponentName.scss
  4. Each CSS class starts with the unique component name
  5. The HTML of each component only uses its own prefixed classes
  6. Components can use other components, but never overwrite their styles