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)=df

justify-content: center

j(justify)+c(content)+c(center)=jcc

align-items: flex-start

a(align)+i(items)+f(flex)+s(start)=aifs

flex-direction: column

f(flex)+d(direction)+c(column)=fdc

margin-top: 16px

m(margin)+t(top)+16px(value + unit)=mt16px
CSSBreakdownClass
display: flexd(isplay) + f(lex)df
display: gridd(isplay) + g(rid)dg
display: noned(isplay) + n(one)dn
display: blockd(isplay) + b(lock)db
display: inline-blockd(isplay) + i(nline)-b(lock)dib
justify-content: centerj(ustify)-c(ontent) + c(enter)jcc
justify-content: space-betweenj(ustify)-c(ontent) + s(pace)-b(etween)jcsb
justify-content: flex-endj(ustify)-c(ontent) + f(lex)-e(nd)jcfe
align-items: centera(lign)-i(tems) + c(enter)aic
align-items: flex-starta(lign)-i(tems) + f(lex)-s(tart)aifs
align-items: flex-enda(lign)-i(tems) + f(lex)-e(nd)aife
flex-direction: columnf(lex)-d(irection) + c(olumn)fdc
flex-direction: rowf(lex)-d(irection) + r(ow)fdr
flex-wrap: wrapf(lex)-w(rap) + w(rap)fww
position: absolutep(osition) + a(bsolute)pa
position: relativep(osition) + r(elative)pr
position: fixedp(osition) + f(ixed)pf
position: stickyp(osition) + s(ticky)ps
overflow: hiddeno(verflow) + h(idden)oh
overflow: autoo(verflow) + a(uto)oa
cursor: pointerc(ursor) + p(ointer)cp
cursor: defaultc(ursor) + d(efault)cd
text-align: centert(ext)-a(lign) + c(enter)tac
text-align: leftt(ext)-a(lign) + l(eft)tal
text-decoration: nonet(ext)-d(ecoration) + n(one)tdn
text-transform: uppercaset(ext)-t(ransform) + u(ppercase)ttu
white-space: nowrapw(hite)-s(pace) + n(owrap)wsn
text-overflow: ellipsist(ext)-o(verflow) + e(llipsis)toe
object-fit: covero(bject)-f(it) + c(over)ofc
user-select: noneu(ser)-s(elect) + n(one)usn
pointer-events: nonep(ointer)-e(vents) + n(one)pen
visibility: hiddenv(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}

CSSBreakdownClass
margin-top: 16pxm(argin)-t(op) + 16pxmt16px
margin-bottom: 2.4remm(argin)-b(ottom) + 2.4rem (dot → hyphen)mb2-4rem
padding: 16pxp(adding) + 16pxp16px
padding-left: 2remp(adding)-l(eft) + 2rempl2rem
font-size: 1.6remf(ont)-s(ize) + 1.6remfs1-6rem
gap: 8pxgap + 8pxgap8px
gap: 2remgap + 2remgap2rem
width: 100pxw(idth) + 100pxw100px
width: 50%w(idth) + 50 + p(%)w50p
height: 100vhh(eight) + 100vhh100vh
max-width: 120remmax-w(idth) + 120remmaxw120rem
min-height: 100vhmin-h(eight) + 100vhminh100vh
border-radius: 8pxb(order)-r(adius) + 8pxbr8px
line-height: 1.7l(ine)-h(eight) + 1.7 (dot → hyphen)lh1-7
letter-spacing: 0.05eml(etter)-s(pacing) + 0.05emls0-05em
top: 0t(op) + 0t0
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

UnitUsageExample
pxPixelsw100px
p (%)Percentw50p
remRoot em (1rem = 10px)fs1-6rem
emRelative emp1em
vhViewport heighth100vh
vwViewport widthw100vw
vminViewport minw50vmin
vmaxViewport maxw50vmax
frGrid fractiongtc1fr-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.

ClassCSS Output
gap1-5remgap: 1.5rem
fs1-4remfont-size: 1.4rem
lh1-7line-height: 1.7
ls0-05emletter-spacing: 0.05em
mt2-4remmargin-top: 2.4rem

2. Value separator (Grid)

In grid classes, hyphens separate multiple values that become spaces in CSS.

ClassCSS Output
gtc1fr-2fr-1frgrid-template-columns: 1fr 2fr 1fr
gtc200px-auto-1frgrid-template-columns: 200px auto 1fr
gtrauto-1fr-autogrid-template-rows: auto 1fr auto
gtcr3-1frgrid-template-columns: repeat(3, 1fr)
gtcrfit-minmax28rem-1frgrid-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.

ClassCSS 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.

ClassCSS 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.

ClassCSS Output
w100pxiwidth: 100px !important
dnidisplay: none !important
mt0imargin-top: 0 !important
dfidisplay: flex !important
tacitext-align: center !important

neg- prefix = negative value

Prefix with neg- to produce a negative value.

ClassCSS Output
neg-mt10pxmargin-top: -10px
neg-ml2remmargin-left: -2rem
neg-t5pxtop: -5px
neg-l10pxleft: -10px
neg-zi5z-index: -5
neg-order1order: -1

p = percent (%)

Use p as a unit suffix to represent %.

ClassCSS Output
w50pwidth: 50%
w100pwidth: 100%
h100pheight: 100%
l50pleft: 50%
t50ptop: 50%
maxw80pmax-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.

ClassCSSWhy?
fs0flex-shrink: 0No unit = flex-shrink
fs1flex-shrink: 1No unit = flex-shrink
fs16pxfont-size: 16pxHas unit = font-size
fs1-6remfont-size: 1.6remHas unit = font-size
prposition: relativeNo unit = position
pr16pxpadding-right: 16pxHas unit = padding-right
br4pxborder-radius: 4pxHas unit = border-radius
br50pborder-radius: 50%Has unit = border-radius
fg1flex-grow: 1No unit, number only = flex-grow
fw600font-weight: 600No 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:

CSSBreakdownClass
table-layout: fixedt(able)-l(ayout) + f(ixed)tlf
border-collapse: collapseb(order)-c(ollapse) + c(ollapse)bcc
object-fit: covero(bject)-f(it) + c(over)ofc
object-fit: containo(bject)-f(it) + c(on)t(ain)ofct
white-space: nowrapw(hite)-s(pace) + n(owrap)wsn
white-space: pre-wrapw(hite)-s(pace) + p(re)-w(rap)wspw
text-overflow: ellipsist(ext)-o(verflow) + e(llipsis)toe
word-break: break-allw(ord)-b(reak) + b(reak)-a(ll)wbba
overflow-wrap: break-wordo(verflow)-w(rap) + b(reak)-w(ord)owbw
backface-visibility: hiddenb(ack)f(ace)-v(isibility) + h(idden)bfvh
box-sizing: border-boxb(ox)-si(z)ing + b(order)-b(ox)bxzbb
list-style-type: nonel(ist)-s(tyle) + n(one)lsn
resize: noner(esi)z(e) + n(one)rzn
appearance: noneapp(earance) + n(one)appn
background-size: coverb(ackground)-s(ize) + c(over)bsc
background-attachment: fixedbg(background)-a(ttachment) + f(ixed)bgaf
vertical-align: middlev(ertical)-a(lign) + m(iddle)vam
caption-side: bottomc(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)

PrefixPropertyExampleCSS Output
ccolorcFFFFFFcolor: #FFFFFF
ccolorc333333color: #333333
bgbackground-colorbgFFFFFFbackground-color: #FFFFFF
bgbackground-colorbg000000background-color: #000000
bcborder-colorbcDDDDDDborder-color: #DDDDDD
bcborder-colorbc6366F1border-color: #6366F1

RGBA colors

Format: {prefix}{R}-{G}-{B}-{Alpha} where Alpha is 0-100 (mapped to 0.0-1.0).

ClassCSS Output
c255-0-0-100color: rgba(255, 0, 0, 1)
c0-0-0-50color: rgba(0, 0, 0, 0.5)
bg0-0-0-50background-color: rgba(0, 0, 0, 0.5)
bg255-255-255-80background-color: rgba(255, 255, 255, 0.8)
bg99-102-241-10background-color: rgba(99, 102, 241, 0.1)

Opacity

ClassCSS Output
o0opacity: 0
o50opacity: 0.5
o80opacity: 0.8
o100opacity: 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.