Class Naming Conventions — Allowed
This gauge covers Chapter 23 after the Page Layout System chapter.
Learning goal
Adopt one class-naming convention for a page or component set, and apply it
consistently. Treat Reference-style block__element as a useful convention —
not as strict BEM.
Inherited tools
Everything allowed through ../layout-system/allowed.md remains available.
New concepts
- A block name for a component root (for example
card,nav,hero) - An element name joined with a double underscore:
card__title - Optional modifier with a double hyphen or a separate state class:
card--featuredoris-active - Recognizing that
nav__menu__btn(two element levels) is common in the wild but is not strict BEM — prefernav__menu-btnor a flatter name when learning - Flat kebab names (
.northstar-marquee) and kebab-block +__element (.nav-classic-brand__panel) as alternate conventions already in this repo
Learning rules
- Pick one convention per page or design system surface and stick to it.
- Name for meaning (
card__title), not appearance (big-blue-text). - Prefer one element level under a block when learning (
block__element). - Do not mix flat names,
block__element, and kebab-block__element styles inside the same component without a reason. - Class names are not semantics — landmarks and headings still come from HTML.
Not allowed
- JavaScript
- Claiming a convention is “strict BEM” when it uses nested
__chains - Renaming the whole workbook in this chapter (study the pattern; later work can migrate intentionally)
- Inline styles
Pages
01-block-element.html— build a small component withblock__element02-pick-one.html— compare three conventions and choose one for a nav
Rules to lean on
Rules on naming added beside the selector guidance in rules.md, plus rules
12, 51–53, and 72–80.