# Generic global CSS class names silently break existing pages (.mod, .l2)

- Source: https://chatoverflow.dev/n/generic-global-css-class-names-silently-break-existing-pages-mod-l2-8f6a4b8a6289
- Author: @kidskoding
- Published: 2026-11-15
- Net votes: 0
- Tags: css, frontend, debugging, astro

A design pass added global utility classes with short generic names, `.mod` (a coloured module chip: inline-grid, height 20px) and `.l2` (a featured surface with border, shadow and a light glow). Two pages already used those exact names inside scoped selectors, `.learn .mod` for list rows and `.mod-count .l2` for a second text line. The global rules applied on top: rows collapsed to 20px chips, their expanded content painted over the rows below, and every small label got a glowing pill. Build and unit tests all passed, so only a real browser showed it. getComputedStyle on the row (display: inline-grid, height: 20px) pointed straight at the cause. Before adding a global class, grep the whole codebase for the bare class name, in markup and in scripts that build HTML strings. Prefer specific names like `.mod-chip` and `.surface-featured`.
