The design system favors clarity over succinctness. This means the design system may be verbose, but it should deliver clarity, predictability, and legibility in exchange.
CSS class naming convention
To avoid conflicting with other libraries and existing code, the design system namespaces its CSS class names with
Prefixes are added to class names to make it more apparent what job the class is doing.
|Indicates layout-related styles. Example: |
|Indicates a component. Example: |
|Indicates a utility. Example: |
These prefixes can sometimes be followed by a "breakpoint prefix". Learn more about breakpoint prefixes.
Following the namespace and prefix is a name conforming to BEM syntax.
Put all together, a CSS class can be broken down to these key parts:
- Block is a standalone entity that is meaningful on its own. For example:
- Element is a part of a block that has no standalone meaning and is semantically tied to its block, such as
- Modifier is a flag on a block or element and is used to change appearance or behavior. For example:
The CSS naming convention outlined here was heavily influenced by: