Naming Convention
Atomic CSS has ONE rule: take the first letter of each word in a CSS property and value, combine them, and that's your class name. Once you understand this, you can guess almost any class.
The Formula
CSS property: value → first letters of property + first letters of value = class name
Basic Rule
For properties with keyword values (no numbers), just combine the first letters.
How it works
display: flex
d(display)+f(flex)=dfjustify-content: center
j(justify)+c(content)+c(center)=jccalign-items: flex-start
a(align)+i(items)+f(flex)+s(start)=aifsflex-direction: column
f(flex)+d(direction)+c(column)=fdcmargin-top: 16px
m(margin)+t(top)+16px(value + unit)=mt16px| CSS | Breakdown | Class |
|---|---|---|
| display: flex | d(isplay) + f(lex) | df |
| display: grid | d(isplay) + g(rid) | dg |
| display: none | d(isplay) + n(one) | dn |
| display: block | d(isplay) + b(lock) | db |
| display: inline-block | d(isplay) + i(nline)-b(lock) | dib |
| justify-content: center | j(ustify)-c(ontent) + c(enter) | jcc |
| justify-content: space-between | j(ustify)-c(ontent) + s(pace)-b(etween) | jcsb |
| justify-content: flex-end | j(ustify)-c(ontent) + f(lex)-e(nd) | jcfe |
| align-items: center | a(lign)-i(tems) + c(enter) | aic |
| align-items: flex-start | a(lign)-i(tems) + f(lex)-s(tart) | aifs |
| align-items: flex-end | a(lign)-i(tems) + f(lex)-e(nd) | aife |
| flex-direction: column | f(lex)-d(irection) + c(olumn) | fdc |
| flex-direction: row | f(lex)-d(irection) + r(ow) | fdr |
| flex-wrap: wrap | f(lex)-w(rap) + w(rap) | fww |
| position: absolute | p(osition) + a(bsolute) | pa |
| position: relative | p(osition) + r(elative) | pr |
| position: fixed | p(osition) + f(ixed) | pf |
| position: sticky | p(osition) + s(ticky) | ps |
| overflow: hidden | o(verflow) + h(idden) | oh |
| overflow: auto | o(verflow) + a(uto) | oa |
| cursor: pointer | c(ursor) + p(ointer) | cp |
| cursor: default | c(ursor) + d(efault) | cd |
| text-align: center | t(ext)-a(lign) + c(enter) | tac |
| text-align: left | t(ext)-a(lign) + l(eft) | tal |
| text-decoration: none | t(ext)-d(ecoration) + n(one) | tdn |
| text-transform: uppercase | t(ext)-t(ransform) + u(ppercase) | ttu |
| white-space: nowrap | w(hite)-s(pace) + n(owrap) | wsn |
| text-overflow: ellipsis | t(ext)-o(verflow) + e(llipsis) | toe |
| object-fit: cover | o(bject)-f(it) + c(over) | ofc |
| user-select: none | u(ser)-s(elect) + n(one) | usn |
| pointer-events: none | p(ointer)-e(vents) + n(one) | pen |
| visibility: hidden | v(isibility) + h(idden) | vh |
Key Insight
Notice the pattern: hyphenated CSS words like flex-direction contribute TWO letters (f + d). Same for values like flex-start (f + s).
Properties with Units
When a CSS value includes a number and unit, append them directly after the property abbreviation.
Formula: {property abbreviation}{number}{unit}
| CSS | Breakdown | Class |
|---|---|---|
| margin-top: 16px | m(argin)-t(op) + 16px | mt16px |
| margin-bottom: 2.4rem | m(argin)-b(ottom) + 2.4rem (dot → hyphen) | mb2-4rem |
| padding: 16px | p(adding) + 16px | p16px |
| padding-left: 2rem | p(adding)-l(eft) + 2rem | pl2rem |
| font-size: 1.6rem | f(ont)-s(ize) + 1.6rem | fs1-6rem |
| gap: 8px | gap + 8px | gap8px |
| gap: 2rem | gap + 2rem | gap2rem |
| width: 100px | w(idth) + 100px | w100px |
| width: 50% | w(idth) + 50 + p(%) | w50p |
| height: 100vh | h(eight) + 100vh | h100vh |
| max-width: 120rem | max-w(idth) + 120rem | maxw120rem |
| min-height: 100vh | min-h(eight) + 100vh | minh100vh |
| border-radius: 8px | b(order)-r(adius) + 8px | br8px |
| line-height: 1.7 | l(ine)-h(eight) + 1.7 (dot → hyphen) | lh1-7 |
| letter-spacing: 0.05em | l(etter)-s(pacing) + 0.05em | ls0-05em |
| top: 0 | t(op) + 0 | t0 |
| left: 50% | l(eft) + 50 + p(%) | l50p |
% is written as p
Since % can't be used in CSS class names, use p instead. Example: w50p = width: 50%, h100p = height: 100%.
Supported units
| Unit | Usage | Example |
|---|---|---|
| px | Pixels | w100px |
| p (%) | Percent | w50p |
| rem | Root em (1rem = 10px) | fs1-6rem |
| em | Relative em | p1em |
| vh | Viewport height | h100vh |
| vw | Viewport width | w100vw |
| vmin | Viewport min | w50vmin |
| vmax | Viewport max | w50vmax |
| fr | Grid fraction | gtc1fr-2fr |
Hyphen (-) Usage
The hyphen character (-) serves 4 different purposes depending on context. Understanding these is essential.
1. Decimal point
Since CSS class names can't contain a dot, the hyphen replaces the decimal point.
| Class | CSS Output |
|---|---|
gap1-5rem | gap: 1.5rem |
fs1-4rem | font-size: 1.4rem |
lh1-7 | line-height: 1.7 |
ls0-05em | letter-spacing: 0.05em |
mt2-4rem | margin-top: 2.4rem |
2. Value separator (Grid)
In grid classes, hyphens separate multiple values that become spaces in CSS.
| Class | CSS Output |
|---|---|
gtc1fr-2fr-1fr | grid-template-columns: 1fr 2fr 1fr |
gtc200px-auto-1fr | grid-template-columns: 200px auto 1fr |
gtrauto-1fr-auto | grid-template-rows: auto 1fr auto |
gtcr3-1fr | grid-template-columns: repeat(3, 1fr) |
gtcrfit-minmax28rem-1fr | grid-template-columns: repeat(auto-fit, minmax(28rem, 1fr)) |
3. Media query prefix
A breakpoint prefix followed by a hyphen activates the class only at that screen size.
| Class | CSS Output |
|---|---|
sm-dn | @media (max-width: 768px) { display: none } |
md-fdc | @media (max-width: 1024px) { flex-direction: column } |
lg-gtcr2-1fr | @media (max-width: 1280px) { grid-template-columns: repeat(2, 1fr) } |
es-db | @media (max-width: 640px) { display: block } |
4. Pseudo-class prefix
Pseudo-class names followed by a hyphen apply styles on specific states.
| Class | CSS Output |
|---|---|
hover-bg333333 | :hover { background-color: #333333 } |
hover-cFFFFFF | :hover { color: #FFFFFF } |
focus-bc6366F1 | :focus { border-color: #6366F1 } |
active-bg000000 | :active { background-color: #000000 } |
hover-o80 | :hover { opacity: 0.8 } |
How to tell them apart?
Context makes it clear: if it starts with a known breakpoint prefix (sm, md, lg...) it's a media query. If it starts with hover, focus, etc. it's a pseudo-class. If it's between numbers, it's a decimal or value separator.
Special Suffixes & Prefixes
i suffix = !important
Add i to the end of any class to add !important.
| Class | CSS Output |
|---|---|
w100pxi | width: 100px !important |
dni | display: none !important |
mt0i | margin-top: 0 !important |
dfi | display: flex !important |
taci | text-align: center !important |
neg- prefix = negative value
Prefix with neg- to produce a negative value.
| Class | CSS Output |
|---|---|
neg-mt10px | margin-top: -10px |
neg-ml2rem | margin-left: -2rem |
neg-t5px | top: -5px |
neg-l10px | left: -10px |
neg-zi5 | z-index: -5 |
neg-order1 | order: -1 |
p = percent (%)
Use p as a unit suffix to represent %.
| Class | CSS Output |
|---|---|
w50p | width: 50% |
w100p | width: 100% |
h100p | height: 100% |
l50p | left: 50% |
t50p | top: 50% |
maxw80p | max-width: 80% |
Disambiguation
Some abbreviations map to multiple CSS properties. The key rule: the presence or absence of a unit determines which property it refers to.
| Class | CSS | Why? |
|---|---|---|
fs0 | flex-shrink: 0 | No unit = flex-shrink |
fs1 | flex-shrink: 1 | No unit = flex-shrink |
fs16px | font-size: 16px | Has unit = font-size |
fs1-6rem | font-size: 1.6rem | Has unit = font-size |
pr | position: relative | No unit = position |
pr16px | padding-right: 16px | Has unit = padding-right |
br4px | border-radius: 4px | Has unit = border-radius |
br50p | border-radius: 50% | Has unit = border-radius |
fg1 | flex-grow: 1 | No unit, number only = flex-grow |
fw600 | font-weight: 600 | No unit, 100-900 range = font-weight |
Remember
No unit = keyword property (flex-shrink, position, etc.). With unit = size property (font-size, padding-right, border-radius, etc.). This is consistent throughout the entire system.
Guess ANY CSS Property
The naming convention is universal. Even if a class isn't documented, you can derive it from the rule. Here are examples across many different CSS properties:
| CSS | Breakdown | Class |
|---|---|---|
| table-layout: fixed | t(able)-l(ayout) + f(ixed) | tlf |
| border-collapse: collapse | b(order)-c(ollapse) + c(ollapse) | bcc |
| object-fit: cover | o(bject)-f(it) + c(over) | ofc |
| object-fit: contain | o(bject)-f(it) + c(on)t(ain) | ofct |
| white-space: nowrap | w(hite)-s(pace) + n(owrap) | wsn |
| white-space: pre-wrap | w(hite)-s(pace) + p(re)-w(rap) | wspw |
| text-overflow: ellipsis | t(ext)-o(verflow) + e(llipsis) | toe |
| word-break: break-all | w(ord)-b(reak) + b(reak)-a(ll) | wbba |
| overflow-wrap: break-word | o(verflow)-w(rap) + b(reak)-w(ord) | owbw |
| backface-visibility: hidden | b(ack)f(ace)-v(isibility) + h(idden) | bfvh |
| box-sizing: border-box | b(ox)-si(z)ing + b(order)-b(ox) | bxzbb |
| list-style-type: none | l(ist)-s(tyle) + n(one) | lsn |
| resize: none | r(esi)z(e) + n(one) | rzn |
| appearance: none | app(earance) + n(one) | appn |
| background-size: cover | b(ackground)-s(ize) + c(over) | bsc |
| background-attachment: fixed | bg(background)-a(ttachment) + f(ixed) | bgaf |
| vertical-align: middle | v(ertical)-a(lign) + m(iddle) | vam |
| caption-side: bottom | c(aption)-s(ide) + b(ottom) | csb |
Pro Tip
When in doubt, use the MCP tools (lookup_class, search_by_css) to verify your guess. The rule works for 95%+ of cases.
Color Naming
Colors use a property prefix followed by the color value (HEX or RGBA).
HEX colors (6-digit)
| Prefix | Property | Example | CSS Output |
|---|---|---|---|
| c | color | cFFFFFF | color: #FFFFFF |
| c | color | c333333 | color: #333333 |
| bg | background-color | bgFFFFFF | background-color: #FFFFFF |
| bg | background-color | bg000000 | background-color: #000000 |
| bc | border-color | bcDDDDDD | border-color: #DDDDDD |
| bc | border-color | bc6366F1 | border-color: #6366F1 |
RGBA colors
Format: {prefix}{R}-{G}-{B}-{Alpha} where Alpha is 0-100 (mapped to 0.0-1.0).
| Class | CSS Output |
|---|---|
c255-0-0-100 | color: rgba(255, 0, 0, 1) |
c0-0-0-50 | color: rgba(0, 0, 0, 0.5) |
bg0-0-0-50 | background-color: rgba(0, 0, 0, 0.5) |
bg255-255-255-80 | background-color: rgba(255, 255, 255, 0.8) |
bg99-102-241-10 | background-color: rgba(99, 102, 241, 0.1) |
Opacity
| Class | CSS Output |
|---|---|
o0 | opacity: 0 |
o50 | opacity: 0.5 |
o80 | opacity: 0.8 |
o100 | opacity: 1 |
Quick Reference
The most commonly used classes you'll memorize quickly.
<!-- Flexbox center -->
<div class="df jcc aic">centered content</div>
<!-- Flex column with gap -->
<div class="df fdc gap16px">stacked items</div>
<!-- Header: logo left, nav right -->
<header class="df jcsb aic px2rem py16px">
<div>Logo</div>
<nav class="df gap2rem">links</nav>
</header>
<!-- Grid 3 columns -->
<div class="dg gtcr3-1fr gap2rem">cards</div>
<!-- Responsive: 3col → 1col -->
<div class="dg gtcr3-1fr sm-gtc1fr gap2rem">cards</div>
<!-- Responsive show/hide -->
<div class="db sm-dn">desktop only</div>
<div class="dn sm-db">mobile only</div>
<!-- Hover button -->
<button class="bg6366F1 hover-bg4F46E5 cFFFFFF py12px px2rem br8px bn cp tall200msease">
Click me
</button>
<!-- Absolute positioned overlay -->
<div class="pr">
<div class="pa t0 l0 w100p h100p bg0-0-0-50 df jcc aic">overlay</div>
</div>
<!-- Text ellipsis (single line) -->
<p class="wsn oh toe">very long text that will be truncated...</p>Tips
Start with the essentials
Memorize these 10 classes first: df, dg, dn, jcc, aic, fdc, pr, pa, oh, cp. You'll use these in almost every component.
Use the MCP tools to verify
When you're unsure, use lookup_class to check what a class outputs, or search_by_css to find the right class for a CSS property.
The rule is consistent
There are very few exceptions. If you learn the one rule (first letter combination), you can derive thousands of classes. The system is predictable by design.
Practice makes fast
After a few components, you'll find yourself typing df jcc aic without thinking. Most developers reach fluency within a day of active use.