# BEM CSS: name the code's parts the way the design does

> A naming decision in a code review shows how design intent can survive a handoff, and why shared components still need review as a site changes.

Source: https://lastdoorsolutions.com/blog/bem-css-design-handoff

**A design survives the move to code when the code names its parts the way the design does.** A card is called a card, its title is the card's title, and a darker card is the same card with one change. BEM is the naming method that does this, and our 2020 front-end guide made it the rule for every build.

## What BEM is

**BEM** stands for block, element, modifier.

- **A block** is a part that stands on its own: `card`.
- **An element** is a piece of that block: `card__title`.
- **A modifier** is a variation of either: `card--dark`.

A designer can read those names. **So can the next developer, years later, without opening the design file.**

## One code review exposed the difference

In a 2020 review, our design lead found a section whose class names mixed layout, appearance and implementation details. The revision made the section and its variations easier to recognise.

**The point was shared meaning.** A developer needed to see which part stayed the same and which part changed. A designer needed to recognise the component in the build. A name that served only one of them left the other to reconstruct the decision.

Naming alone could not settle spacing, line height or behaviour. Those still needed comparison with the design. It made the subject of that comparison clearer.

## A component carries a decision

A variation belongs to an existing component when its underlying purpose stays the same. A different purpose may need a different component. Reusing a name without checking that distinction can hide a design disagreement.

This site, built in 2026, keeps the rule in a different form. Components use scoped stylesheets, with classes or attributes for variations. **The names changed. The rule that the code names what the design shows did not.** It is how we [built a design system for a site that already runs](/blog/build-a-design-system-for-a-running-site), for [Discovery World Trekking](/work/discovery-world-trekking).

## The agreement needs maintaining

A naming convention gives the next person a starting point. It does not guarantee that later work will preserve the design. A new page can introduce a slightly different card, and another page can copy it. Each change looks reasonable in isolation while the site grows less consistent.

**Review connects the names back to what people see and use.** Our current site also checks machine-testable accessibility rules before release. Those checks serve a different purpose: a component can be consistently named and still be difficult to use.

A handoff continues in the decisions made after the first build. The next page either develops the shared component or starts another version of it.

## Handing a design to developers?

Tell us what the design covers and who builds it. We will say how we would keep the build true to it, and what we would check before launch.

[Talk to us about the build](https://lastdoorsolutions.com/contact?service=design)
