Writing Modular Stylesheets with CSS Modules
summary
Explains how CSS Modules makes selectors local by default and adds a unique hash per class derived from the class name and file path so identical class names never collide, shows output as a JSON map for server templates and demos using PostCSS and webpack and a simple PHP example, demonstrates composing styles from other modules to reuse a shared rule, and describes using the global keyword for true global selectors while claiming fewer specificity bugs and easier component-level reuse.
AI-written summary · about
