How clear names express intent,
guide AI, and
keep components stable
—Part of CSS Primer for the AI Era — Structure
This page explains how naming is not a cosmetic choice but a structural tool —
the way humans express intent so AI can style components safely and predictably.
Naming is not decoration.
Naming is structure —
the way we express the
internal shape of a component
so CSS (and AI) can understand what
belongs together.
A quiet mental model:
'Names' describe the shape.
'The shape' determines how style can flow.
This page explores:
A name should describe:
A name should not describe:
Examples of meaningful names:
card_headernav_itemform-field_labelmodal_footerExamples of misleading names:
A quiet principle:
Name things for their purpose,
not their appearance.
This keeps structure stable even when style changes.
A component is a shape —
a set of parts arranged with intention.
Naming makes that shape visible:
card_headercard_bodycard_footerThis tells AI:
Without naming,
AI sees only a pile of divs.
A quiet truth:
AI cannot infer structure.
Humans must express it.
Clear names create 'boundaries'.
Examples:
Boundaries prevent:
Boundaries make components:
easy for AI to reason about
A quiet rule:
If the boundary is clear,
the styles will be calm.
When names are clear:
!important becomes unnecessaryWhen names are unclear:
!important becomes temptingNaming is the first line of defense against CSS complexity.
A quiet reminder:
Good names
prevent bad selectors.
AI does not “see” the whole codebase.
It only sees what we show it.
Clear naming helps AI:
For example:
If we show AI:
<div class="card__header">
AI understands:
Naming
gives AI the map.
When asking AI for help,
naming becomes a language.
Compare:
Weak request:
“Make the top part of the box bigger.”
Clear request:
“Increase the padding on .card__header.”
Or:
Weak request:
“Highlight the selected item.”
Clear request:
“Add a modifier class like nav__item--active
and style it accordingly.”
Naming gives humans the vocabulary to guide AI.
A quiet truth:
Clear names
make clear prompts.
Naming is not about syntax.
It is about:
Good naming:
Naming
is part of the design.
However, we do not need to follow 'strict naming conventions'
unless there is a reason for them.
But we always need to express structure clearly.
We can use:
card-headercard_headerCardHeaderdata-part=“header”The model remains the same:
A quiet reminder:
The names can change.
The clarity must remain.
Naming is the foundation of style.
It tells CSS where to go.
It tells AI what belongs together.
It tells humans how the component is shaped.
A quiet closing thought:
'Structure' gives style its shape.
'Naming' gives structure its voice.
And when the names are clear,
the styles become effortless.
Tony de Araujo —New York | Lisbon