Skip to Content
DocumentationSummarized Cheat-sheet Doc

Quick AliasCSS Reference Guide


AliasCSS — Quick Documentation Date: April 22, 2026

1. INTRODUCTION & PHILOSOPHY

AliasCSS is a Hybrid version of CSS DSL and utility-first CSS framework where styles are applied by writing CSS property-value pairs directly as HTML class names. If you know CSS, you already know AliasCSS.

AliasCSS is:

  • Atomic CSS
  • Selector engine
  • Component system
  • Animation DSL
  • Runtime compiler
  • Layer architecture
  • Closer to a CSS programming language than a framework

Core Principles:

PrincipleMeaning
AtomicOne class = one CSS property
ComposableCombine any classes freely
DeterministicStrict grammar, predictable output

2. INSTALLATION

NPM

npm install --save-dev aliascss

CDN

<script defer src="https://cdn.jsdelivr.net/npm/aliascss@latest/dist/aliascss.js"></script>

Step 1: Install

npm install --save-dev aliascss

Step 2: Create aliascss.config.js in project root

const config = { input: ['app/**/*.(jsx|tsx)', 'components/**/*.(jsx|tsx)'], output: { location: 'public/css/master.css', '--file': true, }, }; export default config;

Step 3: Compile

npx aliascss --config

Step 4: Watch

npx aliascss --config --watch

package.json Scripts

"scripts": { "aliascss-build": "aliascss --config", "aliascss-watch": "aliascss --config --watch" }

3. CORE GRAMMAR

Every AliasCSS classname is parsed in this exact order:

(@layer and/or media) → (pseudo and/Or selector )→ property → value

Examples

<div class="@[base,md]-d-flex"></div> <div class="md--hover-bgc-blue"></div> <div class="--hover_h3-c-red"></div> <div class="xs-fdc"></div> <div class="dark-bgc-0e0e0e"></div>

4. BASIC USAGE & CLASSNAME RULES

Core Rule — Replace : with -

color:blue → color-blue display:flex → display-flex font-size:3rem → font-size-3rem margin-left:32px → margin-left-32px left:-100px → left--100px

Negative Values — use -- before numeric value

margin--12px → margin: -12px left--20px → left: -20px box-shadow--1px-0px-2px-black → box-shadow: -1px 0px 2px black transform-rotateY--90deg → transform: rotateY(-90deg) margin-100px--100px-100px--100px → margin: 100px -100px 100px -100px

Decimal Values

Always use 0.1rem not .1rem

Multi-Value Properties — separate with - especially for length based values.

margin-10px-20px → margin: 10px 20px border-1px-solid-red → border: 1px solid red padding-10px-20px-10px-20px → padding: 10px 20px 10px 20px grid-column-1/2 → grid-column: 1 / 2 grid-column-1/--2 → grid-column: 1 / -2

Multi-Layer Values — use __ double underscore

bxs-1px-1px-red__2px-2px-blue → box-shadow: 1px 1px red, 2px 2px blue txs-1px-1px-red__2px-2px-blue → text-shadow: 1px 1px red, 2px 2px blue ff-Inter__Segoe_UI__sans-serif → font-family: Inter, "Segoe UI", sans-serif

Font Family Rules

_ = space within a font name → Times_New_Roman = "Times New Roman" __ = comma separator → Inter__Arial = Inter, Arial

Numeric Shorthand 1–10

For padding, margin, gap — compiles to n × 0.25rem:

m-4 → margin: 1rem p-8 → padding: 2rem g-2 → gap: 0.5rem mx-4 → margin-left: 1rem; margin-right: 1rem

CSS Variables

bgc--main-bg → background-color: var(--main-bg) bgc--main-bg:blue → background-color: var(--main-bg, blue) w--var--24x → width: var(--24x) [use --var-- for numeric names] w--24x → width: -24x [WRONG - treated as negative]

Non-Numeric Length Values

w-fc → width: fit-content w-xc → width: max-content w-mc → width: min-content w-min(40%,400px) → width: min(40%, 400px) w-max(40%,400px) → width: max(40%, 400px) w-clamp(20rem,30vw,70rem) → width: clamp(20rem, 30vw, 70rem)

5. STATIC VS DYNAMIC CLASSNAMES

Static Classnames

display-flex, font-weight-900, align-items-center, text-decoration-underline, position-relative, flex-direction-column, justify-content-center

Dynamic Classnames

margin-200px, color-green, font-size-1.2em, border-1px-solid-e3e3e3, background-linear-gradient-135deg-blue-red, width-clamp(20rem,30vw,70rem), box-shadow-0px-4px-12px-black/3

6. SHORTHAND SYSTEMS

Method 1 — Generic (Fast Prototyping)

CSSShorthand
display:flexdf
display:inline-flexdif
display:griddg
display:blockdb
display:nonedn
flex-direction:rowfdr
flex-direction:columnfdc
flex-direction:row-reversefdrr
flex-direction:column-reversefdcr
text-align:centertac
text-align:righttar
text-align:lefttal
font-weight:900fw9
font-weight:800fw8
font-weight:700fw7
font-weight:boldfwb
justify-content:space-betweenjcsb
justify-content:centerjcc
align-items:centeraic
align-items:stretchais
overflow:hiddenoh
overflow:autooa
list-style:nonelsn
border:nonebn
font-style:italicfsi
font-style:normalfsnl
font-weight:lighterfwl
font-weight:thinfw-thin
CSSOptions
display:flexd-flex / d-f / display-f
align-items:centerai-c / ai-center / align-items-c
flex-direction:columnfd-c / fd-column / flex-direction-c
background-color:redbgc-red / background-color-red
font-size:16pxfs-16px / font-size-16px
margin-left:32pxml-32px / margin-left-32px
padding-top:16pxpt-16px / padding-top-16px
border-radius:8pxbr-8px / border-radius-8px

7. PROPERTY ALIAS — COMPLETE REFERENCE

Accent & Appearance

AliasProperty
accentaccent-color
apappearance

Animation

AliasProperty
aanimation
ancanimation-composition
adlanimation-delay
adanimation-direction
aduanimation-duration
afmanimation-fill-mode
aicanimation-iteration-count
ananimation-name
apsanimation-play-state
atfanimation-timing-function
atanimation-timeline
ar2animation-range
areanimation-range-end
arsanimation-range-start

Alignment & Justify

AliasProperty
acalign-content
aialign-items
asalign-self
abalignment-baseline
jcjustify-content
jijustify-items
jsjustify-self
pcplace-content
psplace-self

Aspect & Size

AliasProperty
araspect-ratio
wwidth
hheight
xwmax-width
mwmin-width
xhmax-height
mhmin-height
isinline-size
xbsmax-block-size
xismax-inline-size

Background

AliasProperty
bgbackground
bgabackground-attachment
bgbmbackground-blend-mode
bgclbackground-clip
bgcbackground-color
bgibackground-image
bgobackground-origin
bgpbackground-position
bgpxbackground-position-x
bgpybackground-position-y
bgrbackground-repeat
bgsbackground-size

Border

AliasProperty
bborder
bbborder-bottom
bbcborder-bottom-color
bblrborder-bottom-left-radius
bbrrborder-bottom-right-radius
bbsborder-bottom-style
bbwborder-bottom-width
bbecborder-block-end-color
bbesborder-block-end-style
bbewborder-block-end-width
bbscborder-block-start-color
bbssborder-block-start-style
bbswborder-block-start-width
bcborder-color
beerborder-end-end-radius
besrborder-end-start-radius
biborder-inline
bicborder-inline-color
biecborder-inline-end-color
biesborder-inline-end-style
biewborder-inline-end-width
biscborder-inline-start-color
bissborder-inline-start-style
biswborder-inline-start-width
bisborder-inline-style
biwborder-inline-width
birborder-image-repeat
blborder-left
blcborder-left-color
blsborder-left-style
blwborder-left-width
brborder-radius
brtborder-right
brcborder-right-color
brsborder-right-style
brwborder-right-width
bsborder-style
bserborder-start-end-radius
bssrborder-start-start-radius
btborder-top
btcborder-top-color
btlrborder-top-left-radius
btrrborder-top-right-radius
btsborder-top-style
btwborder-top-width
bwborder-width
bdbbox-decoration-break
bxrbox-reflect
bxsbox-shadow
bscborder-spacing
bcpborder-collapse

Color & Content

AliasProperty
ccolor
lclighting-color
contcontent
cvcontent-visibility
cicounter-increment

Columns

AliasProperty
cccolumn-count
cfcolumn-fill
cgcolumn-gap
crcolumn-rule
crccolumn-rule-color
crscolumn-rule-style
crwcolumn-rule-width
cscolumn-span
cwcolumn-width
colscolumns

Cursor & Interaction

AliasProperty
curcursor
pepointer-events
toatouch-action
ususer-select
rsresize
wcwill-change

Display & Visibility

AliasProperty
ddisplay
vvisibility
ecempty-cells
dirdirection

Effects & Filters

AliasProperty
bfbackdrop-filter
bvbackface-visibility
flfilter
cpclip-path
mbmmix-blend-mode
oopacity

Flexbox

AliasProperty
fxflex
fbflex-basis
fdflex-direction
fflflex-flow
fgflex-grow
fskflex-shrink
fwpflex-wrap
ffloat
ordorder
ggap
rgrow-gap

Font & Typography

AliasProperty
fffont-family
ffsfont-feature-settings
fkfont-kerning
flofont-language-override
fsfont-size
fsafont-size-adjust
fstfont-style
fvfont-variant
fvafont-variant-alternates
fvcfont-variant-caps
fveafont-variant-east-asian
fvlfont-variant-ligatures
fvnfont-variant-numeric
fvpfont-variant-position
fvefont-variant-emoji
fwfont-weight
fcaforced-color-adjust
hphanging-punctuation

Grid

AliasProperty
gdgrid
gagrid-area
gacgrid-auto-columns
gafgrid-auto-flow
gargrid-auto-rows
gcgrid-column
gcegrid-column-end
gcggrid-column-gap
gcsgrid-column-start
gggrid-gap
grgrid-row
gregrid-row-end
grggrid-row-gap
grsgrid-row-start
gtgrid-template
gtagrid-template-areas
gtcgrid-template-columns
gtrgrid-template-rows

Image & Media

AliasProperty
ioimage-orientation
irimage-rendering
ilinitial-letter
soshape-outside
sitshape-image-threshold

Inset & Position

AliasProperty
iinset
iainset-area
ibinset-block
ibeinset-block-end
ibsinset-block-start
iiinset-inline
iieinset-inline-end
iisinset-inline-start
posposition
paposition-anchor
ttop
rright
btmbottom
lleft
ziz-index

Letter, Line & Text

AliasProperty
lesletter-spacing
lbline-break
lhline-height
lslist-style
lsilist-style-image
lsplist-style-position
lstlist-style-type
tatext-align
taltext-align-last
tdtext-decoration
tdctext-decoration-color
tdlntext-decoration-line
tdstext-decoration-style
tdttext-decoration-thickness
tetext-emphasis
tectext-emphasis-color
titext-indent
tjtext-justify
totext-overflow
txstext-shadow
tttext-transform
tuptext-underline-offset
twtext-wrap
twmtext-wrap-mode
twstext-wrap-style

Margin

AliasProperty
mmargin
mbemargin-block-end
mbsmargin-block-start
mbmargin-bottom
mimargin-inline
miemargin-inline-end
mismargin-inline-start
mlmargin-left
mrmargin-right
mtmargin-top

Offset & Motion Path

AliasProperty
ofaoffset-anchor
ofdoffset-distance
ofpoffset-path
ofposoffset-position
ofroffset-rotate
rtrotate
sscale

Outline

AliasProperty
oloutline
olcoutline-color
olooutline-offset
olsoutline-style
olwoutline-width

Overflow & Overscroll

AliasProperty
ofoverflow
ocmoverflow-clip-margin
oaoverflow-anchor
owoverflow-wrap
oxoverflow-x
oyoverflow-y
olayoverlay
oboverscroll-behavior
obboverscroll-behavior-block
obioverscroll-behavior-inline
obxoverscroll-behavior-x
obyoverscroll-behavior-y

Padding

AliasProperty
ppadding
pbepadding-block-end
pbspadding-block-start
pbpadding-bottom
pipadding-inline
piepadding-inline-end
pispadding-inline-start
plpadding-left
prpadding-right
ptpadding-top

Page & Print

AliasProperty
pgpage
pbapage-break-after
pbbpage-break-before
pbipage-break-inside
popaint-order
pcaprint-color-adjust
orporphans
widwidows
qquotes

Perspective & Transform

AliasProperty
persperspective
persoperspective-origin
tftransform
tfbtransform-box
tfotransform-origin
tfstransform-style

Transition

AliasProperty
tntransition
tbtransition-behavior
tdltransition-delay
tdutransition-duration
tptransition-property
ttftransition-timing-function

Scroll

AliasProperty
sbscroll-behavior
smscroll-margin
smbescroll-margin-block-end
smbsscroll-margin-block-start
smbscroll-margin-bottom
smiscroll-margin-inline
smiescroll-margin-inline-end
smisscroll-margin-inline-start
smlscroll-margin-left
smrscroll-margin-right
smtscroll-margin-top
spscroll-padding
spbescroll-padding-block-end
spbsscroll-padding-block-start
spbscroll-padding-bottom
spiscroll-padding-inline
spiescroll-padding-inline-end
spisscroll-padding-inline-start
splscroll-padding-left
sprscroll-padding-right
sptscroll-padding-top
ssascroll-snap-align
sssscroll-snap-stop
sstscroll-snap-type
stscroll-timeline
stascroll-timeline-axis
stnscroll-timeline-name

Scrollbar

AliasProperty
sbcscrollbar-color
sbgscrollbar-gutter
sbwscrollbar-width

Table & Misc

AliasProperty
tstab-size
tltable-layout
tlstimeline-scope
ubunicode-bidi
vavertical-align
wosword-spacing
wswhite-space
wscwhite-space-collapse
wbword-break
wwword-wrap
wmwriting-mode
zozoom

View & Scroll Timeline

AliasProperty
vtview-timeline
vtnview-timeline-name
vtaview-timeline-axis
vtiview-timeline-inset
vtn2view-transition-name

SVG

AliasProperty
strstroke
fofill-opacity
frfill-rule
sdastroke-dasharray
sdostroke-dashoffset
swstroke-width
slcstroke-linecap
sljstroke-linejoin
vevector-effect

8. COLOR SYSTEM

Named Colors

<div class="c-red bgc-skyBlue bc-blue"></div>
ClassnameShorthandCompiled
color-redc-redcolor: red
background-color-skyBluebgc-skyBluebackground-color: skyBlue
border-color-bluebc-blueborder-color: blue
border-1px-solid-blackb-1px-s-blackborder: 1px solid black
box-shadow-0px--2px-2px-orangebxs-0px--2px-2px-orangebox-shadow: 0px -2px 2px orange

Hex Colors — without # (3, 6, or 8 digits)

ClassnameCompiled
c-ff0000color: #ff0000
bgc-0f172abackground-color: #0f172a
bc-cccborder-color: #ccc
c-e3e3e3color: #e3e3e3
bgc-01010e55background-color: #01010e55 (8-digit with alpha)
b-1px-s-ff0000border: 1px solid #ff0000
bxs-0px--2px-2px-ff0000box-shadow: 0px -2px 2px #ff0000

RGB / RGBA / HSL / HSLA / HWB

All color functions follow the same syntax — function name followed by values separated by -:

ClassnameShorthandCompiled
color-rgb-255-0-0c-rgb-255-0-0color: rgb(255 0 0)
color-rgba-255-0-0-0.4c-rgba-255-0-0-0.4color: rgba(255 0 0 / 0.4)
background-color-hsl-0-100%-50%bgc-hsl-0-100%-50%background-color: hsl(0 100% 50%)
border-color-hwb-0-0%-0%bc-hwb-0-0%-0%border-color: hwb(0 0% 0%)
border-1px-solid-hsl-0-100%-50%-0.5b-1px-s-hsl-0-100%-50%-0.5border: 1px solid hsl(0 100% 50% / 0.5)
box-shadow-0px--2px-2px-rgba-255-0-0-0.8bxs-0px--2px-2px-rgba-255-0-0-0.8box-shadow: 0px -2px 2px rgba(255 0 0 / 0.8)
background-color-rgb--primary-colorbgc-rgb--primary-colorbackground-color: rgb(var(--primary-color))

LAB / OKLAB / LCH / OKLCH

ClassnameShorthandCompiled
color-lab-54.3-106.83-40.85c-lab-54.3-106.83-40.85color: lab(54.3 106.83 40.85)
color-oklab-0.63-0.22-0.13c-oklab-0.63-0.22-0.13color: oklab(0.63 0.22 0.13)
background-color-lch-54.3-106.83-40.85bgc-lch-54.3-106.83-40.85background-color: lch(54.3 106.83 40.85)
border-color-oklch-0.628-0.2577-29.23bc-oklch-0.628-0.2577-29.23border-color: oklch(0.628 0.2577 29.23)
background-color-oklch--primary-colorbgc-oklch--primary-colorbackground-color: oklch(var(--primary-color))

Alpha Shorthand /0–9

Append /digit to named colors, hex, CSS variables, or custom colors. Uses oklch color space to modify the alpha channel. Cannot be used with color functions like rgb(), hsl() etc.

ClassnameShorthandCompiled
color-red/9c-red/9color: oklch(from red l c h / 0.9)
color-red/8c-red/8color: oklch(from red l c h / 0.8)
color-red/7c-red/7color: oklch(from red l c h / 0.7)
color-red/5c-red/5color: oklch(from red l c h / 0.5)
color-red/3c-red/3color: oklch(from red l c h / 0.3)
color-red/1c-red/1color: oklch(from red l c h / 0.1)
color-ffffff/1c-ffffff/1color: oklch(from #ffffff l c h / 0.1)
color-primary600/5c-primary600/5color: oklch(from var(--primary600,#7F56D9) l c h / 0.5)
color--bg-color/7c--bg-color/7color: oklch(from var(--bg-color) l c h / 0.7)
bgc-blue/3bgc-blue/3background-color: oklch(from blue l c h / 0.3)
b-1px-s-black/5b-1px-s-black/5border: 1px solid oklch(from black l c h / 0.5)

CSS Variables for Complex Colors

<h1 class="c--fg-color bg--bg-color fs-3rem" style=" --fg-color: color-mix(in srgb, red, white 20%); --bg-color: hsl(from var(--primary) h s calc(l - 20%)); " > Hello, World </h1>

9. LAYOUT

Length-Based Properties Reference

padding(p), margin(m), gap(g), width(w), height(h), border-width(bw), line-height(lh), letter-spacing(les), border-radius(br), text-indent(ti), text-shadow(txs), box-shadow(bxs), top(t), bottom(btm), right(r), left(l), outline-width(olw), background-size(bgs), background-position(bgp), inline-size(is), block-size, margin-block, padding-block
ClassnameShorthandCompiled
width-200pxw-200pxwidth: 200px
max-width-960pxxw-960pxmax-width: 960px
min-width-600pxmw-600pxmin-width: 600px
height-100vhh-100vhheight: 100vh
min-height-200pxmh-200pxmin-height: 200px
margin-2remm-2remmargin: 2rem
margin-2rem-12pxm-2rem-12pxmargin: 2rem 12px
margin--2rem-12pxm--2rem-12pxmargin: -2rem 12px
margin--2rem--12pxm--2rem--12pxmargin: -2rem -12px
margin-12px-0px-12px--8pxm-12px-0px-12px--8pxmargin: 12px 0px 12px -8px
margin-x-12pxmx-12pxmargin-right: 12px; margin-left: 12px
margin-x-4mx-4margin-right: 1rem; margin-left: 1rem
padding-32px-24pxp-32px-24pxpadding: 32px 24px
padding-top-16pxpt-16pxpadding-top: 16px
border-radius-10pxbr-10pxborder-radius: 10px
box-shadow--1px-0px-2px-4px-black/7bxs--1px-0px-2px-4px-black/7box-shadow: -1px 0px 2px 4px oklch(from black l c h / 0.7)
text-shadow-1px-1px-4px-blacktxs-1px-1px-4px-blacktext-shadow: 1px 1px 4px black
gap-16pxg-16pxgap: 16px
z-index-100zi-100z-index: 100

Non-Numeric Length Values

ClassnameShorthandCompiled
width-max-contentw-xcwidth: max-content
width-min-contentw-mcwidth: min-content
width-fit-contentw-fcwidth: fit-content
width-min(40%,400px)w-min(40%,400px)width: min(40%, 400px)
width-max(40%,400px)w-max(40%,400px)width: max(40%, 400px)
width-clamp(20rem,30vw,70rem)w-clamp(20rem,30vw,70rem)width: clamp(20rem, 30vw, 70rem)

Use CSS variables for complex values:

<div class="w--header-width mx-auto" style="--header-width: clamp(min(10vw,20rem), 300px, max(90vw,55rem))" ></div>

Flexbox

ClassnameShorthandCompiled
display-flexdf or d-fdisplay: flex
display-inline-flexdif or d-ifdisplay: inline-flex
gap-16pxg-16pxgap: 16px
align-content-startac-salign-content: start
align-items-centerai-calign-items: center
align-self-stretchas-salign-self: stretch
justify-content-space-betweenjc-sbjustify-content: space-between
justify-content-centerjc-cjustify-content: center
flex-shrink-0fsk-0flex-shrink: 0
flex-basis-200pxfb-200pxflex-basis: 200px
flex-grow-0fg-0flex-grow: 0
flex-direction-rowfd-r or fdrflex-direction: row
flex-direction-row-reversefd-rr or fdrrflex-direction: row-reverse
flex-direction-columnfd-c or fdcflex-direction: column
flex-direction-column-reversefd-cr or fdcrflex-direction: column-reverse
flex-wrap-wrapfwp-wrapflex-wrap: wrap
flex-wrap-nowrapfwp-nowrapflex-wrap: nowrap
order-1ord-1order: 1

Grid

ClassnameShorthandCompiled
display-griddg or d-gdisplay: grid
display-inline-griddig or d-igdisplay: inline-grid
grid-template-columns-repeat-3-1frgtc-repeat-3-1frgrid-template-columns: repeat(3, 1fr)
grid-template-rows-repeat-3-1frgtr-repeat-3-1frgrid-template-rows: repeat(3, 1fr)
grid-template-rows-200px-1frgtr-200px-1frgrid-template-rows: 200px 1fr
grid-template-columns-repeat-auto-fill-200pxgtc-repeat-auto-fill-200pxgrid-template-columns: repeat(auto-fill, 200px)
grid-auto-rows-200pxgar-200pxgrid-auto-rows: 200px
grid-auto-rows-minmax-100px-autogar-minmax-100px-autogrid-auto-rows: minmax(100px, auto)
grid-column-start-2gcs-2grid-column-start: 2
grid-column-end-4gce-4grid-column-end: 4
grid-row-start-1grs-1grid-row-start: 1
grid-row-end-span-3gre-span-3grid-row-end: span 3
grid-column-1/2gc-1/2grid-column: 1 / 2
grid-column-1/--2gc-1/--2grid-column: 1 / -2
grid-row-1/4gr-1/4grid-row: 1 / 4
grid-area-1/1/4/2ga-1/1/4/2grid-area: 1 / 1 / 4 / 2

Grid with CSS variables:

<section class="gtc--panel-layout gta--named-areas" style=' --panel-layout: repeat(3, [col-start] 1fr [col-end]); --named-areas: "header header header" "sidebar main main" "footer footer footer" ' ></section>

Display

ClassnameShorthandCompiled
display-blockdb or d-bdisplay: block
display-inline-blockdib or d-ibdisplay: inline-block
display-inlinedi or d-idisplay: inline
display-nonedn or d-ndisplay: none
display-contentsdc or d-cdisplay: contents
display-tabledt or d-tdisplay: table
display-list-itemdli or d-lidisplay: list-item

Positioning

ClassnameShorthandCompiled
position-absolutepaposition: absolute
position-relativeprposition: relative
position-fixedpfposition: fixed
position-staticpsposition: static
position-stickypstposition: sticky
top-20pxt-20pxtop: 20px
right-20pxr-20pxright: 20px
bottom-20pxbtm-20pxbottom: 20px
left--20pxl--20pxleft: -20px
inset-0i-0inset: 0
inset-0pxi-0pxinset: 0px
z-index-10zi-10z-index: 10
z-index-100zi-100z-index: 100
z-index--1zi--1z-index: -1

Overflow

ClassnameShorthandCompiled
overflow-hiddenohoverflow: hidden
overflow-autooaoverflow: auto
overflow-scrollosoverflow: scroll
overflow-visibleovoverflow: visible
overflow-y-autooyaoverflow-y: auto
overflow-x-autooxaoverflow-x: auto
overflow-y-scrolloysoverflow-y: scroll
overflow-x-scrolloxsoverflow-x: scroll
overflow-y-hiddenoyhoverflow-y: hidden
overflow-x-hiddenoxhoverflow-x: hidden

Float & Clear

ClassnameShorthandCompiled
float-rightfrfloat: right
float-leftflfloat: left
float-nonefnfloat: none
clear-leftclclear: left
clear-rightcrclear: right
clear-bothcbclear: both

10. BORDER & SHADOW

Border

ClassnameShorthandCompiled
border-nonebnborder: none
border-radius-12pxbr-12pxborder-radius: 12px
border-radius-50%br-50%border-radius: 50%
border-width-1pxbw-1pxborder-width: 1px
border-width-1px-2pxbw-1px-2pxborder-width: 1px 2px
border-1px-solid-redb-1px-s-redborder: 1px solid red
border-1px-dashed--border-colorb-1px-d--border-colorborder: 1px dashed var(--border-color)
border-right-1px-solid-redbrt-1px-s-redborder-right: 1px solid red
border-top-1px-solid-redbt-1px-s-redborder-top: 1px solid red
border-left-1px-solid-redbl-1px-s-redborder-left: 1px solid red
border-bottom-1px-solid-redbb-1px-s-redborder-bottom: 1px solid red
border-color-redbc-redborder-color: red
border-color-cccbc-cccborder-color: #ccc
border-bottom-color-redbbc-redborder-bottom-color: red
border-top-left-radius-8pxbtlr-8pxborder-top-left-radius: 8px
border-top-right-radius-8pxbtrr-8pxborder-top-right-radius: 8px
border-bottom-left-radius-8pxbblr-8pxborder-bottom-left-radius: 8px
border-bottom-right-radius-8pxbbrr-8pxborder-bottom-right-radius: 8px
border-style-solidbssborder-style: solid
border-style-dashedbsdborder-style: dashed
border-style-dottedbsdtborder-style: dotted
border-style-doublebsdbborder-style: double
border-style-groovebsgborder-style: groove
border-style-insetbsiborder-style: inset
border-style-nonebsnborder-style: none
border-collapse-collapsebcp-collapseborder-collapse: collapse
border-collapse-separatebcp-separateborder-collapse: separate

Box Shadow

ClassnameShorthandCompiled
box-shadow-1px-1px-1px-redbxs-1px-1px-1px-redbox-shadow: 1px 1px 1px red
box-shadow-inset-5em-1em-blue200bxs-i-5em-1em-blue200box-shadow: inset 5em 1em var(--blue200,#B2DDFF)
box-shadow-2px-2px-2px-2px-rgb-231-0-0-0.4bxs-2px-2px-2px-2px-rgb-231-0-0-0.4box-shadow: 2px 2px 2px 2px rgb(231 0 0 / 0.4)
box-shadow-2px-2px-red__1px-1px-4px-skyBluebxs-2px-2px-red__1px-1px-4px-skyBluebox-shadow: 2px 2px red, 1px 1px 4px skyBlue
box-shadow--1px-0px-2px-black/7bxs--1px-0px-2px-black/7box-shadow: -1px 0px 2px oklch(from black l c h / 0.7)

CSS variables for complex shadows:

<button class="d-if b-1px-s-primary600 bxs--shadow-sm" style="--shadow-sm: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1)" > Button </button>

11. FONT & TEXT

Font Properties

ClassnameShorthandCompiled
font-size-16pxfs-16pxfont-size: 16px
font-size-1.2emfs-1.2emfont-size: 1.2em
font-size-2remfs-2remfont-size: 2rem
font-family-interff-interfont-family: inter
font-family-Inter__Segoe_UI__Arial__sans-serifff-Inter__Segoe_UI__Arial__sans-seriffont-family: Inter, "Segoe UI", Arial, sans-serif
font-family--apple-system__BlinkMacSystemFont__sans-serifff--apple-system__BlinkMacSystemFont__sans-seriffont-family: -apple-system, BlinkMacSystemFont, sans-serif
font-family-Georgia__Times_New_Roman__serifff-Georgia__Times_New_Roman__seriffont-family: Georgia, "Times New Roman", serif
font-style-italicfsifont-style: italic
font-style-obliquefsofont-style: oblique
font-style-normalfsnlfont-style: normal
font-weight-900fw9font-weight: 900
font-weight-800fw8font-weight: 800
font-weight-700fw7font-weight: 700
font-weight-600fw6 or fw-600font-weight: 600
font-weight-500fw5 or fw-500font-weight: 500
font-weight-400fw4 or fw-400font-weight: 400
font-weight-thinfw-thinfont-weight: 100
font-weight-boldfwbfont-weight: bold
font-weight-lighterfwlfont-weight: lighter
line-height-1.5lh-1.5line-height: 1.5
line-height-24pxlh-24pxline-height: 24px
letter-spacing-0.05emles-0.05emletter-spacing: 0.05em

Font family rules:

  • Use _ for spaces within a font name: Times_New_Roman"Times New Roman"
  • Use __ as comma separator between entries: Inter__ArialInter, Arial

Text Properties

ClassnameShorthandCompiled
text-align-centertactext-align: center
text-align-righttartext-align: right
text-align-lefttaltext-align: left
text-align-justifytajtext-align: justify
text-align-last-lefttalltext-align-last: left
text-decoration-underlinetdutext-decoration: underline
text-decoration-nonetdntext-decoration: none
text-decoration-line-throughtdlttext-decoration: line-through
text-transform-uppercasettutext-transform: uppercase
text-transform-capitalizettctext-transform: capitalize
text-transform-lowercasettltext-transform: lowercase
text-transform-nonettntext-transform: none
text-overflow-ellipsisto-ellipsistext-overflow: ellipsis
text-overflow-clipto-cliptext-overflow: clip
text-indent-16pxti-16pxtext-indent: 16px
text-wrap-balancetext-wrap: balance
text-wrap-wraptext-wrap: wrap
text-wrap-nowraptext-wrap: nowrap
text-wrap-prettytext-wrap: pretty
text-wrap-stabletext-wrap: stable
white-space-nowrapws-nowrapwhite-space: nowrap
white-space-prews-prewhite-space: pre
white-space-pre-wrapws-pwwhite-space: pre-wrap
word-break-break-allwb-baword-break: break-all
word-wrap-break-wordww-bwword-wrap: break-word
vertical-align-middleva-mvertical-align: middle
vertical-align-topva-tvertical-align: top
vertical-align-bottomva-bvertical-align: bottom

Text Shadow

ClassnameShorthandCompiled
text-shadow-1px-1px-1px-redtxs-1px-1px-1px-redtext-shadow: 1px 1px 1px red
text-shadow-2px-2px-rgb-231-0-0-0.4txs-2px-2px-rgb-231-0-0-0.4text-shadow: 2px 2px rgb(231 0 0 / 0.4)
text-shadow-2px-2px-1px-red__1px-1px-4px-skyBluetxs-2px-2px-1px-red__1px-1px-4px-skyBluetext-shadow: 2px 2px 1px red, 1px 1px 4px skyBlue

12. TRANSFORM

Transform Function Reference

ClassnameShorthandCompiled
transform-matrix3d-1-0-0-0-0-1-0-0-0-0-1-0-0-0-0-1tf-matrix3d-1-0-0-0-0-1-0-0-0-0-1-0-0-0-0-1transform: matrix3d(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1)
transform-perspective-17pxtf-p-17pxtransform: perspective(17px)
transform-rotate-0.5turntf-r-0.5turntransform: rotate(0.5turn)
transform-rotate3d-1-2-3-10degtf-r3d-1-2-3-10degtransform: rotate3d(1, 2, 3, 10deg)
transform-rotateX-10degtf-rx-10degtransform: rotateX(10deg)
transform-rotateY-10degtf-ry-10degtransform: rotateY(10deg)
transform-rotateZ-10degtf-rz-10degtransform: rotateZ(10deg)
transform-translate-12px-50%tf-t-12px-50%transform: translate(12px, 50%)
transform-translate3d-12px-50%-3emtf-t3d-12px-50%-3emtransform: translate3d(12px, 50%, 3em)
transform-translateX-2emtf-tx-2emtransform: translateX(2em)
transform-translateY-3intf-ty-3intransform: translateY(3in)
transform-translateZ-2pxtf-tz-2pxtransform: translateZ(2px)
transform-scale-2-0.5tf-s-2-0.5transform: scale(2, 0.5)
transform-scale3d-2.5-1.2-0.3tf-s3d-2.5-1.2-0.3transform: scale3d(2.5, 1.2, 0.3)
transform-scaleX-2tf-sx-2transform: scaleX(2)
transform-scaleY-0.5tf-sy-0.5transform: scaleY(0.5)
transform-scaleZ-0.3tf-sz-0.3transform: scaleZ(0.3)
transform-skew-30deg-20degtf-sk-30deg-20degtransform: skew(30deg, 20deg)
transform-skewX-30degtf-skx-30degtransform: skewX(30deg)
transform-skewY-1.07radtf-sky-1.07radtransform: skewY(1.07rad)

Chaining Multiple Transforms — use __

ClassnameShorthandCompiled
transform-translateX-10px__rotate-10deg__translateY-5pxtf-tx-10px__r-10deg__ty-5pxtransform: translateX(10px) rotate(10deg) translateY(5px)
transform-perspective-500px__rotateY-3degtf-p-500px__ry-3degtransform: perspective(500px) rotateY(3deg)
tf-rotateY-180deg__translateZ-60pxsametransform: rotateY(180deg) translateZ(60px)
tf-rotateY--90deg__translateZ-60pxsametransform: rotateY(-90deg) translateZ(60px)
tf-rx-90deg__tz-60pxsametransform: rotateX(90deg) translateZ(60px)

3D Properties

ClassnameCompiled
transform-style-preserve-3dtransform-style: preserve-3d
transform-style-flattransform-style: flat
perspective-600pxperspective: 600px
backface-visibility-hiddenbackface-visibility: hidden
backface-visibility-visiblebackface-visibility: visible
transform-origin-centertransform-origin: center
transform-origin-50%-50%transform-origin: 50% 50%

Spinning 3D Cube Example

<div class=" mh-50vh d-flex ai-center jc-center bgc-0f0c29 " style="background: linear-gradient(135deg, #0f0c29, #302b63, #24243e)"> <!-- Scene wrapper: enables 3D perspective --> <div class=" w-200px h-200px d-flex ai-center jc-center perspective-600px "> <!-- Cube root: preserve-3d + spin animation --> <div keyframes-spin="@0-[tf-rotateX-20deg__rotateY-0deg] @100-[tf-rotateX-20deg__rotateY-360deg]" class="pr w-120px h-120px transform-style-preserve-3d an-spin adu-8s atf-linear aici" > <!-- 6 Faces via child selector: .cube > div --> <!-- Front --> <div class=" [pa,w-120px,h-120px,bgc-rgb-255-255-255-0.15,b-1px-s-rgba-255-255-255-0.35,br-6px,bf-blur-6px]--as-cube-face cube-face tf-translateZ-60px "></div> <!-- Back --> <div class="cube-face tf-rotateY-180deg__translateZ-60px"></div> <!-- Left --> <div class="cube-face tf-rotateY--90deg__translateZ-60px "></div> <!-- Right --> <div class="cube-face tf-rotateY-90deg__translateZ-60px"></div> <!-- Top --> <div class="cube-face tf-rx-90deg__tz-60px"></div> <!-- Bottom --> <div class="cube-face tf-rotateX--90deg__translateZ-60px"></div> </div> </div> </div>

13. CSS SELECTORS

Pseudo Selectors & States

Add --flag prefix to target pseudo-selectors and states:

<div class="bgc-ccc --hover-bgc-yellow --h-bgc-yellow"></div> <button class="bgc-blue --focus-outline-none --disabled-o-0.5"></button> <input class="b-1px-s-gray --focus-b-1px-s-blue --invalid-b-1px-s-red">

Complete Pseudo Flag Reference

FlagShort FlagCSS Selector
--active--a / --ac:active
--after--af::after
--after-hover--afh::after:hover
--autofill--atf:-webkit-autofill
--anylink--al:-webkit-anylink
--backdrop--bd::backdrop
--before--bf::before
--before-hover--bfh::before:hover
--blank--bl:blank
--checked--ch:checked
--cue--cu::cue
--current--cur:current
--default--de:default
--disabled--di:disabled
--empty--em:empty
--enabled--en:enabled
--first-child--fc:first-child
--first-letter--fl::first-letter
--first-line--fln::first-line
--first-of-type--fot:first-of-type
--focus--f / --fo:focus
--focus-within--fw:focus-within
--focus-visible--fv:focus-visible
--file-selector-button--fsb::file-selector-button
--fullscreen--fs::fullscreen
--hover--h / --ho:hover
--has--hs:has
--hover-after--haf:hover::after
--hover-before--hbf:hover::before
--hover-target--htg:hover:target
--in-range--ir:in-range
--indeterminate--ind:indeterminate
--invalid--inv:invalid
--is--is:is
--lang--lan:lang
--last-child--lc:last-child
--last-of-type--lot:last-of-type
--link--ln / --l:link
--not---n-:not()
--nth-child---nc-:nth-child()
--nth-last-child---nlc-:nth-last-child()
--nth-last-of-type---nlot-:nth-last-of-type()
--nth-of-type---nthot-:nth-of-type()
--marker--m::marker
--only-of-type--oot:only-of-type
--only-child--oc:only-child
--optional--op:optional
--out-of-range--oor:out-of-range
--placeholder--ph::placeholder
--placeholder-shadow--phs::placeholder-shadow
--popover-open--po:popover-open
--read-only--ro:read-only
--read-write--rw:read-write
--required--rq:required
--root--rt:root
--selection--s::selection
--scrollbar / --webkit-scrollbar--sb::-webkit-scrollbar
--scrollbar-track / --webkit-scrollbar-track--st::-webkit-scrollbar-track
--scrollbar-thumb / --webkit-scrollbar-thumb--stm::-webkit-scrollbar-thumb
--spelling-error--se::spelling-error
--target--tg:target
--user-invalid--ui:user-invalid
--valid--va:valid
--visited--vi / --v:visited
--where--w:where

Pseudo Examples

ClassnameShorthandCompiled
--hover-display-flex--h-df:hover { display: flex }
--focus-list-style-none--fo-lsn:focus { list-style: none }
--nth-child-2n-margin-left-20px--nc-2n-ml-20px:nth-child(2n) { margin-left: 20px }
--placeholder-color-gray400--ph-c-gray400::placeholder { color: var(--gray400) }
--hover-background-color-blue--h-bgc-blue:hover { background-color: blue }
--focus-outline-none--fo-oln:focus { outline: none }
--disabled-opacity-0.5--di-o-0.5:disabled { opacity: 0.5 }
--checked-background-color-blue--ch-bgc-blue:checked { background-color: blue }
--first-child-margin-top-0--fc-mt-0:first-child { margin-top: 0 }
--last-child-margin-bottom-0--lc-mb-0:last-child { margin-bottom: 0 }
--before-content-empty--bf-cont-empty::before { content: "" }
--selection-bgc-blue--s-bgc-blue::selection { background-color: blue }

Element Selector

Use _ prefix to target child elements:

<div class="_h3-c-white _p-fs-14px _span-fw-600"> <h3>Hello</h3> <p>World</p> <span>Text</span> </div>

Compiles to:

._h3-c-white h3 { color: white; } ._p-fs-14px p { font-size: 14px; } ._span-fw-600 span { font-weight: 600; }

Combinator Selectors

ClassnameCompiledType
_div-df._div-df div { }Descendant
__div-df.__div-df > div { }Direct child
___div-df.___div-df + div { }Adjacent sibling
____div-df.____div-df ~ div { }General sibling
_all-c-red._all-c-red * { }All descendants
_child_div-df._child_div-df > div { }Direct child (named)
_next_div-df._next_div-df + div { }Adjacent sibling (named)
_siblings_div-df._siblings_div-df ~ div { }General sibling (named)

Nested Selectors

<div class="_div_h4-fs-20px"></div> <!-- ._div_h4-fs-20px div h4 { font-size: 20px } --> <div class="_ul_li-c-red"></div> <!-- ._ul_li-c-red ul li { color: red } --> <div class="_nav_ul_li-d-f"></div> <!-- ._nav_ul_li-d-f nav ul li { display: flex } -->

14. ATTRIBUTE SELECTOR

Use [attribute=value] directly in classnames:

<div class="[data-state=open]-d-flex"></div> <div class="[data-state=close]-d-n"></div> <div class="[aria-hidden=true]-v-hidden"></div> <div class="[disabled]-o-0.5"></div> <div class="[class~=code]-ff-mono"></div> <div class="[type=checkbox]-cur-pointer"></div>

Compiles to:

[data-state="open"] { display: flex; } [data-state="close"] { display: none; } [aria-hidden="true"] { visibility: hidden; } [disabled] { opacity: 0.5; } [class~="code"] { font-family: monospace; } [type="checkbox"] { cursor: pointer; }

Rules:

  • Quotes ' and " inside attribute selector classnames are NOT allowed — AliasCSS adds them automatically
  • Attribute selectors follow the standard grammar order: @layer → media → pseudo → selector → property → value

15. FUNCTIONAL SELECTORS

:is(), :has(), :not(), :where()

These accept valid AliasCSS selectors inside their parentheses — NOT raw CSS selectors.

PrefixAliasCSS OutputBehavior
--is()--is():is()Adds space before selector
--has()--hs():has()
--not()--n():not()
--where()--w():where()Adds space before selector
--Is()--Is():is()Removes space before selector
--Has():has()Adds space before selector
--Where()--W():where()Removes space before selector
<div class="--is(_h3,_p)-c-black/8 --Is(--hover)-bgc-black/2"> <h3>Hello</h3> <p>World</p> </div>

Compiles to:

.--is\(_h3\,_p\)-c-black\/8 :is(h3, p) { color: oklch(from black l c h / 0.8); } .--Is\(--hover\)-bgc-black\/2:is(:hover) { background-color: oklch(from black l c h / 0.2); }

16. MAGIC & IDENTIFIER

By default, element selectors are placed AFTER the classname:

._div-bgc-red div { background-color: red; }

Use & to insert the classname at a specific position — everything before & becomes a parent selector:

<!-- Default behavior --> <div class="_div-bgc-red"></div> <!-- ._div-bgc-red div { background-color: red } --> <!-- With & --> <div class="_div&-bgc-red"></div> <!-- div ._div\&-bgc-red { background-color: red } --> <!-- Class scope --> <div class="_.card&-c-blue"></div> <!-- .card ._.card\&-c-blue { color: blue } --> <!-- Dark mode scoping --> <div class="--is(_html[class~=dark])&-bgc--dark-bg"></div> <!-- :is(html[class~="dark"]) .class { background-color: var(--dark-bg) } -->

& Summary Table

ClassnameCompiled SelectorBehavior
_div-bgc-red._div-bgc-red div { }Default — selector after class
_div&-bgc-reddiv ._div\&-bgc-red { }Class inserted after div
_.card&-bgc-blue.card ._.card\&-bgc-blue { }Class scoped inside .card
--is(_html[class~=dark])&-c-white:is(html[class~="dark"]) .class { }Dark mode parent scope

17. CSS VARIABLES

Referencing Variables

ClassnameShorthandCompiledNotes
background-color--var--main-bgbgc--var--main-bgbackground-color: var(--main-bg)Numeric-safe
background-color--main-bgbgc--main-bgbackground-color: var(--main-bg)Standard
background-color--main-bg:bluebgc--main-bg:bluebackground-color: var(--main-bg, blue)With fallback
color--namec--namecolor: var(--name)
width--var--side-bar-width:200pxw--var--side-bar-width:200pxwidth: var(--side-bar-width, 200px)
width--side-bar-widthw--side-bar-widthwidth: var(--side-bar-width)
width--var--24xw--var--24xwidth: var(--24x)Numeric name
width--24xw--24xwidth: -24xWRONG — negative value
font-size--text-xlfs--text-xlfont-size: var(--text-xl)
background--gradientbg--gradientbackground: var(--gradient)

Declaring Variables via Classname

Format: --var-name:value

<div class="c--grey-alt --grey:--grey-default" style=" --grey-default: rgba(210,213,217,1); --grey-alt: rgba(186,189,194,1) " > <h3 class="c--grey --hover-c--grey-hover --grey-hover:black"> Hello World </h3> </div>

Special naming rules:

  • Variable names ending in -color → value treated as color identifier
  • Variable names ending in -text → value treated as plain string

Variable Rules Summary

  • Use -- for standard variable names: bgc--main-color
  • Use --var-- when variable name starts with a digit: w--var--24x
  • Add :value for fallback: bgc--main-color:blue
  • CSS variables work with ALL AliasCSS properties

Complex Values via Variables

<h1 class="c--fg-color bg--bg-color fs-3rem" style=" --fg-color: color-mix(in srgb, red, white 20%); --bg-color: hsl(from var(--primary) h s calc(l - 20%)); " >Hello World</h1> <div class="gtc--panel-grid gta--named-areas" style=' --panel-grid: repeat(3, [col-start] 1fr [col-end]); --named-areas: "header header header" "sidebar main main" "footer footer footer" ' ></div>

18. MEDIA & RESPONSIVE PREFIXES

Add prefix at the very beginning of any classname:

PrefixCSS Output
xs@media (max-width: 576px)
sm@media (min-width: 576px)
md@media (min-width: 768px)
lg@media (min-width: 992px)
xl@media (min-width: 1200px)
2xl@media (min-width: 1408px)
-xs@media (min-width: 576px)
-sm@media (max-width: 576px)
-md@media (max-width: 768px)
-lg@media (max-width: 992px)
-xl@media (max-width: 1200px)
-2xl@media (max-width: 1408px)
dark / @dark@media (prefers-color-scheme: dark)
light / @light@media (prefers-color-scheme: light)
@hover@media screen and (hover: hover)
@print / print@media print
@landscape@media (orientation: landscape)
@portrait@media (orientation: portrait)
@container-xs@container (max-width: 576px)
@container-sm@container (min-width: 576px)
@container-md@container (min-width: 768px)
@container-lg@container (min-width: 992px)
@container-xl@container (min-width: 1200px)
@container-2xl@container (min-width: 1408px)

Responsive Examples

<!-- Basic responsive --> <div class="xs-fdc md-w-500px lg-d-g dark-bgc-0e0e0e">...</div> <!-- Media + element selector --> <div class="xs_p-fs-14px md_h3-fs-24px">...</div> <!-- @media(max-width:576px) { .xs_p-fs-14px p { font-size:14px } } --> <!-- Media + pseudo --> <div class="md---hover-bgc-blue xs---focus-b-1px-s-red">...</div> <!-- Responsive display --> <div class="xs-dn md-df lg-dg">...</div>

Compiles:

@media (max-width: 576px) { .xs-fdc { flex-direction: column; } } @media (min-width: 768px) { .md-w-500px { width: 500px; } } @media (min-width: 992px) { .lg-d-g { display: grid; } } @media (prefers-color-scheme: dark) { .dark-bgc-0e0e0e { background-color: #0e0e0e; } }

Customize Breakpoints

// aliascss.config.js const config = { media: { prefix: { xs: '@media (max-width: 600px)', sm: '@media (min-width: 600px)', md: '@media (min-width: 900px)', lg: '@media (min-width: 1200px)', xl: '@media (min-width: 1536px)', }, }, }; export default config;

19. LAYER SYSTEM

PrefixCSS Output
@base@layer base
@components / @comps@layer components
@utils / @utilities@layer utilities
@theme@layer theme
<button class="@base-all-unset">Label</button> <!-- @layer base { .\@base-all-unset { all: unset } } --> <div class="@theme-bgc-primary500">...</div> <!-- @layer theme { .\@theme-bgc-primary500 { background-color: var(--primary500) } } -->

Layer + Grouping

<button class="b-0 c-fff bgc-blue @theme-[c-gray,br-4px,bgc-skyBlue]"> Label </button> <div class="@base-[data-state=open][d-flex,l-0]">...</div>

Multiple Query Prefixes

Combine layer + media in one classname using @[layer,media]:

<button class="@[base,xs][b-0,c-fff,bgc-blue]--as-btn btn">Label</button> <div class="@[xs,base][data-state=open][d-flex,l-0]--as-active active">...</div>

Order @[base,xs] compiles to:

@layer base { @media (max-width: 576px) { .btn { border: 0; color: #fff; background-color: blue; } } }

Custom Layer

// aliascss.config.js const config = { media: { prefix: { '@customLayer': '@layer customLayer', '@reset': '@layer reset', }, }, }; export default config;

Usage:

<div class="@customLayer-d-flex @reset-m-0px-p-0px">...</div>

20. GROUPING SYSTEM

Inline Grouping

Avoid repeating prefixes with [class1,class2,class3]:

<!-- Attribute selector grouping --> <div class="[data-state=open]-[d-flex,l-0,t-0]">...</div> <!-- Media grouping --> <div class="xs-[fdc,p-16px,fs-14px]">...</div> <!-- Layer grouping --> <div class="@theme-[bgc-primary500,c-white,br-8px]">...</div> <!-- Multiple pseudo grouping --> <input class="b-1px-s-gray --focus-[b-1px-s-blue,outline-none] --invalid-[b-1px-s-red,bgc-red/1]"> <!-- Dark mode grouping --> <div class="bgc-white dark-[bgc-gray900,c-white,b-1px-s-gray700]">...</div>

All group examples compile each item individually:

[data-state="open"] { display: flex; } [data-state="open"] { left: 0; } [data-state="open"] { top: 0; }

Component Classnames with --as-

Bundle grouped AliasCSS classnames into a reusable component class:

<!-- Single component --> <button class="[b-0,c-fff,bgc-blue,p-8px-16px,br-6px]--as-btn btn"> Label </button> <!-- Component with state --> <button class="[b-0,c-fff,bgc-blue]--as-btn --hover-[bgc-blue/8,c-white]--as-btn btn"> Label </button> <!-- Multiple component names --> <div class="[p-20px,bgc-white,br-8px]--as-[card,box]">...</div> <!-- Attribute + component --> <div class="[data-state=open]-[d-flex,l-0]--as-active active">...</div> <!-- Layer + component --> <div class="@[base,xs]-[b-0,c-fff,bgc-blue]--as-btn btn">...</div>

Compiles to:

.btn { border: 0; color: #fff; background-color: blue; padding: 8px 16px; border-radius: 6px; } .card { padding: 20px; background-color: white; border-radius: 8px; } .box { padding: 20px; background-color: white; border-radius: 8px; }

21. GLOBAL CLASSNAMES

class-[name] Attribute

Define reusable global classnames by grouping valid AliasCSS utilities on any element. Once defined, the classname is available throughout the entire page:

<!-- Define and use container --> <div class="container" class-container="df bgc--main-color oh w-100p h-100p pa t-0 l-0 aic jcc zi-100" > ... </div> <!-- Use anywhere on same page --> <section class="container">...</section> <header class="container">...</header>

Global Classnames with Selectors

Extend a global classname with selector suffix [--pseudo]:

<div class="error" class-error="c-error500 b-1px-s-error500" class-error[--after]="bgc-error100 c-error700 b-1px-s-error700" class-error[--hover]="bgc-error50" class-error[--focus]="outline-none b-2px-s-error600" > Error message </div>

Compiles to:

.error { color: var(--error500); border: 1px solid var(--error500); } .error::after { background-color: var(--error100); color: var(--error700); border: 1px solid var(--error700); } .error:hover { background-color: var(--error50); } .error:focus { outline: none; border: 2px solid var(--error600); }

22. KEYFRAMES & ANIMATION

Syntax

keyframes-[animation-name]="@[percentage]-aliascss @[percentage]-aliascss"

Basic Examples

<!-- Fade out --> <div keyframes-fadeOut="@0-o-1 @100-o-0" class="an-fadeOut adu-1s"> Fade Out </div> <!-- Fade in --> <div keyframes-fadeIn="@0-o-0 @100-o-1" class="an-fadeIn adu-1s"> Fade In </div> <!-- Flash --> <h1 keyframes-flash="@[0,50,100]-o-1 @[25,75]-o-0" class="an-flash adu-2s"> Flash! </h1> <!-- Slide in from left --> <div keyframes-slideIn="@0-[o-0,tf-tx--100%] @100-[o-1,tf-tx-0]" class="an-slideIn adu-0.5s atf-eio"> Slide In </div> <!-- Bounce --> <div keyframes-bounce="@[0,100]-tf-ty-0 @50-tf-ty--20px" class="an-bounce adu-1s atf-eio aici"> Bounce </div> <!-- Pulse --> <div keyframes-pulse="@0-o-1 @50-o-0.5 @100-o-1" class="an-pulse adu-2s aici"> Pulse </div> <!-- Spin --> <div keyframes-spin="@0-tf-r-0deg @100-tf-r-360deg" class="an-spin adu-1s atf-linear aici"> Spin </div>

Multiple Percentages with @[p1,p2,p3]

<!-- Same style applied to 0%, 50%, 100% --> <div keyframes-blink="@[0,100]-o-1 @50-o-0" class="an-blink adu-1s aici">...</div> <!-- Complex multi-step --> <div keyframes-wave="@[0,100]-tf-r-0deg @25-tf-r-20deg @75-tf-r--20deg" class="an-wave adu-1s aici">...</div>

Grouping Properties at a Step with [...]

<!-- Multiple properties at each step --> <div keyframes-pop-up=" @0-[tf-ty-0,tfo-50p-50p,bxs--shadow-down] @100-[tf-ty--50px,tfo-50p-50p,bxs--shadow-up] " class="an-pop-up adu-1.5s ada atf--timing-func aici afmbo" style=" --shadow-up: 0 50px 3px -20px rgba(0,0,0,0.3); --shadow-down: 0 50px 3px -5px rgba(0,0,0,0.3); --timing-func: cubic-bezier(0.250, 0.460, 0.450, 0.940) " ></div> <!-- Loading dots --> <div class="d-flex ai-center jc-center gap-8px" keyframes-loading="@[0,100]-tf-s-1 @50-tf-s-1.5" > <span class="dot" class-dot="br-100p b-5px-solid-555 m-10px an-loading adu-0.6s atf-eio ada aici" ></span> <span class="dot adl-0.2s"></span> <span class="dot adl-0.4s"></span> </div>

Animation Property Reference

AliasPropertyExample Value
ananimation-namean-fadeOut
aduanimation-durationadu-1s / adu-0.6s
adlanimation-delayadl-0.2s / adl-0.5s
atfanimation-timing-functionatf-linear / atf-eio
adanimation-directionad-normal / ad-reverse
adaanimation-direction-alternateada
aicanimation-iteration-countaic-3 / aic-infinite
afmanimation-fill-modeafm-both / afm-forwards
afmboanimation-fill-mode-bothafmbo
apsanimation-play-stateaps-paused

Duration decimal separator: use d for . in durations:

adu-0d6s → animation-duration: 0.6s adu-1d5s → animation-duration: 1.5s adl-0d2s → animation-delay: 0.2s

Timing Function Shorthands

ClassnameCompiled
atf-linearanimation-timing-function: linear
atf-easeanimation-timing-function: ease
atf-eioanimation-timing-function: ease-in-out
atf-eianimation-timing-function: ease-in
atf-eoanimation-timing-function: ease-out
atf--timing-funcanimation-timing-function: var(--timing-func)

23. NPM WORKFLOW & CONFIG

Quick Start Without Config

# Compile once npx aliascss 'public/*.html' 'public/css/acss.css' # Watch mode npx aliascss 'app/**/*.(tsx|jsx)' 'public/css/acss.css' --watch

Output CSS file must exist before running — create it manually if it does not.

package.json Scripts (No Config)

"scripts": { "aliascss-build": "aliascss 'public/*.html' 'public/css/aliascss.css'", "aliascss-watch": "aliascss-build --watch" }

Full aliascss.config.js

const config = { // Input: glob pattern or array of glob patterns input: [ 'app/**/*.(tsx|jsx)', 'components/**/*.(tsx|jsx)', 'public/*.html' ], // Output: master CSS file — must exist or be created manually output: { location: './public/css/acss.css', '--file': true, // also generate per-file .css alongside each source file }, // Customize media/breakpoint prefixes media: { prefix: { xs: '@media (max-width: 600px)', sm: '@media (min-width: 600px)', md: '@media (min-width: 900px)', lg: '@media (min-width: 1200px)', xl: '@media (min-width: 1536px)', '@customLayer': '@layer customLayer', }, }, // CSS Modules support '--module': true, importModuleAs: 'x', // import x from 'file.module.css' // Minify output via cssnano // minify: true, // Name of extractor function extractorFunction: 'x', // Global classname prefix: ac-bgc-red, ac--hover-c-red // prefix: 'ac', // Truncate output on each rebuild (recommended: true) truncate: true, // Custom color tokens — use camelCase, no hyphens or underscores custom: { colors: { main: 'rgb(12,23,45)', theme: '#c6c6c6', themeTextColor: 'var(--theme-text-color, #c3c3c3)', themeBgColor: 'var(--theme-bg-color, #0e0e0e)', primary: 'rgba(124,143,234,1)', }, }, // Extend the compiler with custom properties and aliases extend: { // Override existing property compiler 'background-color': { alias: 'bgc', values: ['transparent:t:no-color'], compiler: (value) => value.replace(/^-/, ''), }, // Custom property mapped to real CSS property shadow: { property: 'box-shadow', compiler: (value) => { value = value.slice(1); const values = { '3xl': '0px 32px 64px -12px var(--shadow-color, rgba(16,24,40,0.14))', '2xl': '0px 24px 48px -12px var(--shadow-color, rgba(16,24,40,0.14))', 'xl': '0px 20px 24px -4px var(--shadow-color, rgba(16,24,40,0.14))', 'lg': '0px 12px 16px -4px var(--shadow-color, rgba(16,24,40,0.14))', 'md': '0px 4px 8px -2px var(--shadow-color, rgba(16,24,40,0.14))', 'sm': '0px 1px 3px var(--shadow-color, rgba(16,24,40,0.14))', 'xs': '0px 1px 2px var(--shadow-color, rgba(16,24,40,0.14))', }; if (values.hasOwnProperty(value)) return values[value]; }, }, // Group compiler: text-xl → font-size + line-height + letter-spacing text: { type: 'group', groups: { 'xs': 'font-size:12px;letter-spacing:0.0025em;line-height:16px', 'sm': 'font-size:14px;letter-spacing:0em;line-height:20px', 'md': 'font-size:16px;letter-spacing:0em;line-height:24px', 'lg': 'font-size:18px;letter-spacing:-0.0025em;line-height:26px', 'xl': 'font-size:20px;letter-spacing:-0.005em;line-height:28px', '2xl': 'font-size:24px;letter-spacing:-0.00625em;line-height:30px', '3xl': 'font-size:28px;letter-spacing:-0.0075em;line-height:36px', '4xl': 'font-size:35px;letter-spacing:-0.01em;line-height:40px', '5xl': 'font-size:60px;letter-spacing:-0.025em;line-height:60px', }, }, // box-[width]-[height]-[padding] box: { type: 'group', compiler: (value) => { let result = ''; const match = /-([-]?[\w\.]+)/; const property = ['width', 'height', 'padding']; value.match(new RegExp(match, 'g')).forEach((e, i) => { if (i < property.length) { result += `${property[i]}:${e.replace(match, '$1') .replace(/(\d)d(\d)/, '$1.$2') .replace(/([\d])p([\s]|$)/, '$1%$2')};`; } }); return result; }, }, // placement-[position]-[top]-[right]-[bottom]-[left] placement: { type: 'group', compiler: (value) => { let result = ''; const match = /-([-]?[\w\.]+)/; const property = ['position', 'top', 'right', 'bottom', 'left']; value.match(new RegExp(match, 'g')).forEach((e, i) => { if (i < property.length) { result += `${property[i]}:${e.replace(match, '$1') .replace(/(\d)d(\d)/, '$1.$2') .replace(/([\d])p([\s]|$)/, '$1%$2')};`; } }); return result; }, }, // colorize-[bg]-[border]-[text] colorize: { type: 'group', compiler: (value, custom) => { let result = ''; const match = /-([-]?[\w\.]+)/; const property = ['background-color', 'border-color', 'color']; value.match(new RegExp(match, 'g')).forEach((e, i) => { if (i < property.length) { if (e.match(/^--[a-zA-Z]/)) { result += `${property[i]}:var(${e});`; } else { result += `${property[i]}:${getCompiler('color').compiler(e, custom)};`; } } }); return result; }, }, // Responsive container widths container: { type: 'group', compiler: (value) => value, groups: { 'xs': 'display:block;margin:auto;width:var(--container-xs,448px)', 'sm': 'display:block;margin:auto;width:var(--container-sm,688px)', 'md': 'display:block;margin:auto;width:var(--container-md,880px)', 'lg': 'display:block;margin:auto;width:var(--container-lg,1136px)', '1': 'display:block;margin:auto;width:var(--container-1,448px)', '2': 'display:block;margin:auto;width:var(--container-2,688px)', '3': 'display:block;margin:auto;width:var(--container-3,880px)', '4': 'display:block;margin:auto;width:var(--container-4,1136px)', }, }, // Responsive section padding section: { type: 'group', compiler: (value) => value, groups: { 'xs': 'display:block;padding:var(--section-padding-xs,24px) auto', 'sm': 'display:block;padding:var(--section-padding-sm,40px) auto', 'md': 'display:block;padding:var(--section-padding-md,64px) auto', 'lg': 'display:block;padding:var(--section-padding-lg,80px) auto', }, }, // import-var: inject CSS variable groups 'import-var': { type: 'group', groups: { spacing: ` --space-1:4px; --space-2:8px; --space-3:12px; --space-4:16px; --space-5:24px; --space-6:32px; --space-7:40px; --space-8:48px; --space-9:64px; `, }, }, }, // Prebuilt semantic classnames with raw CSS output prebuild: { 'text-xl': 'font-size:20px;line-height:30px', 'text-lg': 'font-size:18px;line-height:28px', 'text-md': 'font-size:16px;line-height:24px', 'text-sm': 'font-size:14px;line-height:20px', 'text-xs': 'font-size:12px;line-height:18px', 'radius-xs': 'border-radius:4px', 'radius-sm': 'border-radius:6px', 'radius-md': 'border-radius:8px', 'radius-lg': 'border-radius:12px', 'radius-xl': 'border-radius:16px', 'radius-full': 'border-radius:9999px', 'flex-center': 'display:flex;align-items:center;justify-content:center', 'flex-between': 'display:flex;align-items:center;justify-content:space-between', 'flex-col': 'display:flex;flex-direction:column', 'absolute-fill':'position:absolute;top:0;left:0;width:100%;height:100%', 'sr-only': 'position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border-width:0', }, // Inject static CSS into every compiled output file statement: ` :root { --bg-dark-color: rgba(111,111,111,1); --bg-light-color: rgba(21,21,21,1); --outline-color: blue; } body { font-family: BlinkMacSystemFont, -apple-system, "Segoe UI"; margin: 0; padding: 0; box-sizing: border-box; } *, *::before, *::after { box-sizing: inherit; } `, // Pre-group AliasCSS classnames under a single global classname group: { container: 'df fdc bsbb aic flex-shrink-1 flex-grow-1', section: 'flex-shrink-0 bsbb', 'button-base': 'bgc-gray300 oln --hover-bgc-gray400 bn --focus-outline-none cur-pointer', 'card': 'bgc-white br-8px bxs-0px-2px-8px-black/1 p-24px', 'input-base': 'b-1px-s-gray300 br-6px p-8px-12px fs-14px w-100p --focus-b-1px-s-blue --focus-outline-none', }, // Classnames to skip — avoids conflicts with Bootstrap/Tailwind/custom CSS ignore: [ 'color-primary', 'fs-xl', 'container', 'row', 'col', ], }; export default config;

--file Mode — Per-File CSS Generation

When output['--file'] is true, AliasCSS generates a .css file alongside every source file:

Before:

app/ ├── page.jsx ├── article.jsx └── about/ └── page.jsx

After running npx aliascss --config:

app/ ├── page.jsx ├── page.jsx.css ← generated ├── article.jsx ├── article.jsx.css ← generated └── about/ ├── page.jsx └── page.jsx.css ← generated

Import in Next.js / SvelteKit:

// app/page.jsx import './page.jsx.css' export default function Home() { return <h1 className="fs-24px fw-600 c-gray900">Hello</h1> }

extractorFunction — Classnames Outside class Attribute

// aliascss.config.js const config = { extractorFunction: 'x', };
// Button.tsx import { useState } from 'react'; const x = (y: string) => y; // simple passthrough export default function Button() { const [isActive, setActive] = useState(false); return ( <button onClick={() => setActive(!isActive)} className={ isActive ? x('bgc-primary100 b-1px-s-primary700 c-primary700') : x('bgc-gray200 c-gray700 b-1px-s-gray700') } > Button </button> ); }

CSS Modules with importModuleAs

// aliascss.config.js const config = { '--module': true, importModuleAs: 'x', };
// Button.tsx import { useState } from 'react'; import x from './Button.tsx.module.css'; // auto-generated by AliasCSS export default function Button() { const [isActive, setActive] = useState(false); return ( <button className={ isActive ? x['bgc-primary100 b-1px-s-primary700 c-primary700'] : x['bgc-gray200 c-gray700 b-1px-s-gray700'] } > Button </button> ); }

Config Option Reference

OptionTypeDescription
inputstring / string[]Glob pattern(s) for source files
output.locationstringPath to master CSS output file
output['--file']booleanGenerate per-file CSS alongside source
media.prefixobjectOverride or add breakpoint / layer prefixes
'--module'booleanEnable CSS Modules support
importModuleAsstringModule import identifier
minifybooleanMinify output via cssnano
extractorFunctionstringFunction name to scan for classnames
prefixstringGlobal classname prefix
truncatebooleanClear output on each rebuild
custom.colorsobjectRegister custom color tokens (camelCase)
extendobjectCreate custom property compilers
prebuildobjectPrebuilt classnames with raw CSS
statementstringStatic CSS injected into every output
groupobjectGroup AliasCSS utilities under one name
ignorestring[]Classnames to skip during compilation

24. ADVANCED CUSTOMIZATION

Extend Compiler Property Reference

PropertyTypeDescription
aliasstringShorthand alias for property
valuesArrayPredefined static values
compilerfunctionReceives (value, custom) → returns compiled CSS
propertystringTarget CSS property when name is not a valid CSS property
groupsobjectStatic key → CSS declaration map
typestringSet to 'group' for multi-property output

Compiler names cannot contain numbers or uppercase letters other than the first character.


Complete Real-World Design System Example

// aliascss.config.js — Full Design System import { getCompiler } from 'aliascss'; const config = { input: ['app/**/*.(tsx|jsx)', 'components/**/*.(tsx|jsx)'], output: { location: './public/css/design-system.css', '--file': true }, truncate: true, // Design tokens as CSS variables via statement statement: ` :root { /* Colors */ --primary-50: #f0f9ff; --primary-100: #e0f2fe; --primary-200: #bae6fd; --primary-300: #7dd3fc; --primary-400: #38bdf8; --primary-500: #0ea5e9; --primary-600: #0284c7; --primary-700: #0369a1; --primary-800: #075985; --primary-900: #0c4a6e; --gray-50: #f9fafb; --gray-100: #f3f4f6; --gray-200: #e5e7eb; --gray-300: #d1d5db; --gray-400: #9ca3af; --gray-500: #6b7280; --gray-600: #4b5563; --gray-700: #374151; --gray-800: #1f2937; --gray-900: #111827; /* Spacing */ --space-1: 4px; --space-2: 8px; --space-3: 12px; --space-4: 16px; --space-5: 24px; --space-6: 32px; --space-7: 40px; --space-8: 48px; --space-9: 64px; /* Typography */ --font-sans: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; --font-mono: "JetBrains Mono", "Fira Code", monospace; /* Shadows */ --shadow-color: rgba(16,24,40,0.12); --shadow-xs: 0px 1px 2px var(--shadow-color); --shadow-sm: 0px 1px 3px var(--shadow-color); --shadow-md: 0px 4px 8px -2px var(--shadow-color); --shadow-lg: 0px 12px 16px -4px var(--shadow-color); --shadow-xl: 0px 20px 24px -4px var(--shadow-color); /* Radius */ --radius-sm: 4px; --radius-md: 8px; --radius-lg: 12px; --radius-xl: 16px; --radius-full: 9999px; } *, *::before, *::after { box-sizing: border-box; } body { font-family: var(--font-sans); color: var(--gray-900); background-color: var(--gray-50); margin: 0; padding: 0; } `, // Custom colors from tokens custom: { colors: { primary50: 'var(--primary-50, #f0f9ff)', primary100: 'var(--primary-100, #e0f2fe)', primary200: 'var(--primary-200, #bae6fd)', primary300: 'var(--primary-300, #7dd3fc)', primary400: 'var(--primary-400, #38bdf8)', primary500: 'var(--primary-500, #0ea5e9)', primary600: 'var(--primary-600, #0284c7)', primary700: 'var(--primary-700, #0369a1)', primary800: 'var(--primary-800, #075985)', primary900: 'var(--primary-900, #0c4a6e)', gray50: 'var(--gray-50, #f9fafb)', gray100: 'var(--gray-100, #f3f4f6)', gray200: 'var(--gray-200, #e5e7eb)', gray300: 'var(--gray-300, #d1d5db)', gray400: 'var(--gray-400, #9ca3af)', gray500: 'var(--gray-500, #6b7280)', gray600: 'var(--gray-600, #4b5563)', gray700: 'var(--gray-700, #374151)', gray800: 'var(--gray-800, #1f2937)', gray900: 'var(--gray-900, #111827)', error50: 'var(--error-50, #fef2f2)', error500: 'var(--error-500, #ef4444)', error600: 'var(--error-600, #dc2626)', success50: 'var(--success-50, #f0fdf4)', success500: 'var(--success-500, #22c55e)', warning50: 'var(--warning-50, #fffbeb)', warning500: 'var(--warning-500, #f59e0b)', }, }, // Prebuild semantic tokens prebuild: { // Typography scale 'text-xs': 'font-size:12px;line-height:16px', 'text-sm': 'font-size:14px;line-height:20px', 'text-md': 'font-size:16px;line-height:24px', 'text-lg': 'font-size:18px;line-height:28px', 'text-xl': 'font-size:20px;line-height:30px', 'text-2xl': 'font-size:24px;line-height:32px', 'text-3xl': 'font-size:30px;line-height:38px', 'text-4xl': 'font-size:36px;line-height:44px', 'text-5xl': 'font-size:48px;line-height:60px', // Radius scale 'radius-sm': 'border-radius:4px', 'radius-md': 'border-radius:8px', 'radius-lg': 'border-radius:12px', 'radius-xl': 'border-radius:16px', 'radius-full': 'border-radius:9999px', // Layout helpers 'flex-center': 'display:flex;align-items:center;justify-content:center', 'flex-between': 'display:flex;align-items:center;justify-content:space-between', 'flex-col': 'display:flex;flex-direction:column', 'flex-col-center':'display:flex;flex-direction:column;align-items:center;justify-content:center', 'absolute-fill': 'position:absolute;top:0;left:0;width:100%;height:100%', 'fixed-fill': 'position:fixed;top:0;left:0;width:100%;height:100%', 'sr-only': 'position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border-width:0', 'truncate': 'overflow:hidden;text-overflow:ellipsis;white-space:nowrap', }, // Global reusable groups group: { // Layout 'container': 'w-100p mw-1200px mx-auto px-24px bsbb', 'section': 'w-100p py-64px bsbb', 'grid-2': 'd-g gtc-repeat-2-1fr gap-24px', 'grid-3': 'd-g gtc-repeat-3-1fr gap-24px', 'grid-4': 'd-g gtc-repeat-4-1fr gap-24px', // Components 'card': 'bgc-white br-8px bxs--shadow-sm p-24px b-1px-s-gray200', 'card-hover': 'bgc-white br-8px bxs--shadow-sm p-24px b-1px-s-gray200 --hover-bxs--shadow-md tn-all tdu-0.2s', // Buttons 'btn': 'df aic jcc gap-8px p-10px-18px br-8px fs-14px fw-600 cur-pointer bn tn-all tdu-0.15s', 'btn-primary': 'bgc-primary600 c-white --hover-bgc-primary700 --focus-outline-none --focus-bxs--focus-ring', 'btn-secondary': 'bgc-white c-gray700 b-1px-s-gray300 --hover-bgc-gray50 --focus-outline-none', 'btn-ghost': 'bgc-transparent c-gray600 --hover-bgc-gray100 --focus-outline-none bn', 'btn-danger': 'bgc-error600 c-white --hover-bgc-error700 --focus-outline-none', // Form inputs 'input': 'w-100p b-1px-s-gray300 br-8px p-10px-14px fs-16px c-gray900 bgc-white --focus-b-1px-s-primary500 --focus-outline-none --invalid-b-1px-s-error500 --placeholder-c-gray400', 'label': 'db fs-14px fw-500 c-gray700 mb-6px', 'form-group': 'df fdc gap-6px mb-16px', // Navigation 'nav-link': 'df aic gap-8px p-8px-12px br-6px fs-14px fw-500 c-gray600 td-none --hover-bgc-gray100 --hover-c-gray900 tn-all tdu-0.15s', 'nav-link-active':'df aic gap-8px p-8px-12px br-6px fs-14px fw-500 c-primary700 bgc-primary50 td-none', // Badges 'badge': 'df aic jcc p-2px-8px br-full fs-12px fw-500', 'badge-primary': 'bgc-primary50 c-primary700', 'badge-success': 'bgc-success50 c-success700', 'badge-error': 'bgc-error50 c-error700', 'badge-warning': 'bgc-warning50 c-warning700', // Overlay / Modal 'overlay': 'pf t-0 l-0 w-100p h-100p bgc-black/6 df aic jcc zi-1000', 'modal': 'bgc-white br-12px bxs--shadow-xl p-32px w-100p mw-560px', // Utilities 'divider': 'w-100p h-1px bgc-gray200 my-24px', 'visually-hidden':'pa w-1px h-1px p-0 m--1px oh clip-rect-0-0-0-0 ws-nowrap bw-0', }, // Ignore conflicting classnames ignore: ['container', 'row', 'col', 'card', 'btn', 'nav', 'badge'], // Extend with custom compilers extend: { shadow: { property: 'box-shadow', compiler: (value) => { value = value.slice(1); const values = { '3xl': '0px 32px 64px -12px var(--shadow-color, rgba(16,24,40,0.14))', '2xl': '0px 24px 48px -12px var(--shadow-color, rgba(16,24,40,0.14))', 'xl': '0px 20px 24px -4px var(--shadow-color, rgba(16,24,40,0.14))', 'lg': '0px 12px 16px -4px var(--shadow-color, rgba(16,24,40,0.14))', 'md': '0px 4px 8px -2px var(--shadow-color, rgba(16,24,40,0.14))', 'sm': '0px 1px 3px var(--shadow-color, rgba(16,24,40,0.14))', 'xs': '0px 1px 2px var(--shadow-color, rgba(16,24,40,0.14))', 'inner':'inset 0px 2px 4px var(--shadow-color, rgba(16,24,40,0.06))', 'none': 'none', }; if (values.hasOwnProperty(value)) return values[value]; }, }, text: { type: 'group', groups: { 'xs': 'font-size:12px;letter-spacing:0.0025em;line-height:16px', 'sm': 'font-size:14px;letter-spacing:0em;line-height:20px', 'md': 'font-size:16px;letter-spacing:0em;line-height:24px', 'lg': 'font-size:18px;letter-spacing:-0.0025em;line-height:26px', 'xl': 'font-size:20px;letter-spacing:-0.005em;line-height:28px', '2xl': 'font-size:24px;letter-spacing:-0.00625em;line-height:30px', '3xl': 'font-size:28px;letter-spacing:-0.0075em;line-height:36px', '4xl': 'font-size:35px;letter-spacing:-0.01em;line-height:40px', '5xl': 'font-size:60px;letter-spacing:-0.025em;line-height:60px', }, }, container: { type: 'group', compiler: (value) => value, groups: { 'xs': 'display:block;margin:auto;width:var(--container-xs,448px)', 'sm': 'display:block;margin:auto;width:var(--container-sm,688px)', 'md': 'display:block;margin:auto;width:var(--container-md,880px)', 'lg': 'display:block;margin:auto;width:var(--container-lg,1136px)', 'xl': 'display:block;margin:auto;width:var(--container-xl,1280px)', }, }, }, media: { prefix: { xs: '@media (max-width: 576px)', sm: '@media (min-width: 576px)', md: '@media (min-width: 768px)', lg: '@media (min-width: 992px)', xl: '@media (min-width: 1200px)', '2xl': '@media (min-width: 1408px)', '@base': '@layer base', '@components': '@layer components', '@utils': '@layer utilities', '@theme': '@layer theme', }, }, }; export default config;

QUICK REFERENCE CHEAT SHEET

Most Used Classnames

DISPLAY df display:flex dg display:grid db display:block dib display:inline-block dn display:none di display:inline FLEXBOX fdc flex-direction:column fdr flex-direction:row fwp-wrap flex-wrap:wrap ai-c align-items:center ai-s align-items:stretch jc-c justify-content:center jc-sb justify-content:space-between jc-fe justify-content:flex-end fg-1 flex-grow:1 fsk-0 flex-shrink:0 GRID gtc-repeat-3-1fr grid-template-columns:repeat(3,1fr) gar-minmax-100px-auto grid-auto-rows:minmax(100px,auto) gc-1/3 grid-column:1/3 ga-1/1/3/3 grid-area:1/1/3/3 SPACING m-0 margin:0 mx-auto margin-left:auto;margin-right:auto mt-16px margin-top:16px mb-24px margin-bottom:24px p-16px padding:16px pt-24px padding-top:24px px-32px padding-left:32px;padding-right:32px gap-16px gap:16px SIZING w-100p width:100% h-100vh height:100vh mw-1200px max-width:1200px mh-64px min-height:64px POSITION pa position:absolute pr position:relative pf position:fixed pst position:sticky t-0 top:0 l-0 left:0 i-0 inset:0 zi-10 z-index:10 COLORS c-red color:red c-ff0000 color:#ff0000 bgc-blue background-color:blue bgc-blue/5 background-color:oklch(from blue l c h/0.5) bc-gray300 border-color:var(--gray300) TYPOGRAPHY fs-16px font-size:16px fw-600 font-weight:600 fw9 font-weight:900 fwb font-weight:bold ff-inter font-family:inter lh-1.5 line-height:1.5 tac text-align:center ttu text-transform:uppercase tdn text-decoration:none BORDER b-1px-s-gray300 border:1px solid var(--gray300) br-8px border-radius:8px br-50% border-radius:50% bw-0 border-width:0 EFFECTS o-0.5 opacity:0.5 bxs--shadow-md box-shadow:var(--shadow-md) bf-blur-8px backdrop-filter:blur(8px) tf-tx--50% transform:translateX(-50%) tf-ty--50% transform:translateY(-50%) tf-s-1.05 transform:scale(1.05) tf-r-45deg transform:rotate(45deg) tn-all transition:all tdu-0.2s transition-duration:0.2s ttf-eio transition-timing-function:ease-in-out OVERFLOW oh overflow:hidden oa overflow:auto ox-hidden overflow-x:hidden oy-auto overflow-y:auto PSEUDO STATES --hover-bgc-blue :hover { background-color:blue } --focus-outline-none :focus { outline:none } --disabled-o-0.5 :disabled { opacity:0.5 } --placeholder-c-gray400 ::placeholder { color:var(--gray400) } --checked-bgc-primary :checked { background-color:var(--primary) } --first-child-mt-0 :first-child { margin-top:0 } --last-child-mb-0 :last-child { margin-bottom:0 } --before-cont-empty ::before { content:"" } --after-cont-empty ::after { content:"" } --selection-bgc-primary ::selection { background-color:var(--primary) } RESPONSIVE xs-dn @media(max-width:576px){ display:none } xs-fdc @media(max-width:576px){ flex-direction:column } md-df @media(min-width:768px){ display:flex } md-d-g @media(min-width:768px){ display:grid } lg-gtc-repeat-3-1fr @media(min-width:992px){ grid-template-columns:repeat(3,1fr) } dark-bgc-gray900 @media(prefers-color-scheme:dark){ background-color:var(--gray900) } LAYER @base-all-unset @layer base { all:unset } @theme-bgc-primary @layer theme { background-color:var(--primary) } @utils-df @layer utilities { display:flex } GROUPING --hover-[bgc-blue,c-white,br-8px] xs-[fdc,p-16px,gap-8px] @theme-[bgc-primary,c-white,br-8px] [b-0,c-fff,bgc-blue]--as-btn ANIMATION an-fadeIn adu-0.5s atf-eio an-spin adu-1s atf-linear aici an-bounce adu-1s atf-eio aici

Complete Real-World Component Examples

Responsive Navbar

<nav class=" w-100p h-64px df ai-center jc-sb px-24px bgc-white bb-1px-s-gray200 pst t-0 zi-100 "> <a class="fs-20px fw-700 c-gray900 td-none" href="/">Logo</a> <ul class=" df ai-center gap-4px ls-none m-0 p-0 xs-dn md-df "> ><a class=" p-8px-12px br-6px fs-14px fw-500 c-gray600 td-none --hover-bgc-gray100 --hover-c-gray900 tn-all tdu-0.15s " href="#">Home</a></li> ><a class=" p-8px-12px br-6px fs-14px fw-500 c-gray600 td-none --hover-bgc-gray100 --hover-c-gray900 tn-all tdu-0.15s " href="#">Docs</a></li> ><a class=" p-8px-12px br-6px fs-14px fw-500 c-gray600 td-none --hover-bgc-gray100 --hover-c-gray900 tn-all tdu-0.15s " href="#">Blog</a></li> </ul> <div class="df ai-center gap-8px"> <button class=" p-8px-16px br-8px fs-14px fw-500 c-gray700 bgc-white b-1px-s-gray300 cur-pointer --hover-bgc-gray50 tn-all tdu-0.15s ">Login</button> <button class=" p-8px-16px br-8px fs-14px fw-500 c-white bgc-primary600 bn cur-pointer --hover-bgc-primary700 tn-all tdu-0.15s ">Sign Up</button> </div> </nav>

Hero Section

<section class=" w-100p df fdc ai-center jc-center py-96px px-24px bgc-white ta-center "> <span class=" df ai-center gap-6px p-4px-12px br-full bgc-primary50 c-primary700 fs-12px fw-600 mb-24px "> New Release v2.0 </span> <h1 class=" fs-clamp(36px,5vw,72px) fw-700 c-gray900 lh-1.1 les--0.02em m-0 mb-24px mw-800px "> Style Your UI Without Leaving HTML </h1> <p class=" fs-18px lh-1.6 c-gray500 fw-400 mw-600px m-0 mb-40px "> AliasCSS lets you apply any CSS property directly as a class name. If you know CSS, you already know AliasCSS. </p> <div class="df ai-center gap-12px xs-fdc"> <button class=" p-12px-24px br-8px fs-16px fw-600 c-white bgc-primary600 bn cur-pointer bxs--shadow-sm --hover-bgc-primary700 --hover-bxs--shadow-md tn-all tdu-0.2s ">Get Started</button> <button class=" p-12px-24px br-8px fs-16px fw-600 c-gray700 bgc-white b-1px-s-gray300 cur-pointer --hover-bgc-gray50 tn-all tdu-0.2s ">View Docs</button> </div> </section>

Card Grid

<section class="w-100p px-24px py-64px"> <div class=" d-g gtc-repeat-3-1fr xs-gtc-repeat-1-1fr md-gtc-repeat-2-1fr lg-gtc-repeat-3-1fr gap-24px mw-1200px mx-auto "> <!-- Card --> <div class=" bgc-white br-12px b-1px-s-gray200 bxs--shadow-sm p-24px df fdc gap-16px --hover-bxs--shadow-md --hover-tf-ty--2px tn-all tdu-0.2s "> <div class=" w-48px h-48px br-10px bgc-primary100 df ai-center jc-center fs-24px ">icon</div> <div class="df fdc gap-8px"> <h3 class="fs-18px fw-600 c-gray900 m-0">Card Title</h3> <p class="fs-14px lh-1.6 c-gray500 m-0"> Description text goes here providing context. </p> </div> <a class=" df ai-center gap-6px fs-14px fw-500 c-primary600 td-none mt-auto --hover-c-primary700 tn-all tdu-0.15s " href="#"> Learn more → </a> </div> </div> </section>

Form

<form class=" w-100p mw-480px mx-auto p-32px bgc-white br-12px b-1px-s-gray200 bxs--shadow-sm df fdc gap-20px "> <h2 class="fs-24px fw-700 c-gray900 m-0">Sign In</h2> <div class="df fdc gap-6px"> <label class="fs-14px fw-500 c-gray700">Email</label> <input type="email" class=" w-100p p-10px-14px br-8px b-1px-s-gray300 fs-16px c-gray900 bgc-white --focus-b-1px-s-primary500 --focus-outline-none --placeholder-c-gray400 " placeholder="you@example.com" /> </div> <div class="df fdc gap-6px"> <label class="fs-14px fw-500 c-gray700">Password</label> <input type="password" class=" w-100p p-10px-14px br-8px b-1px-s-gray300 fs-16px c-gray900 bgc-white --focus-b-1px-s-primary500 --focus-outline-none --placeholder-c-gray400 " placeholder="••••••••" /> </div> <button class=" w-100p p-12px br-8px bn cur-pointer fs-16px fw-600 c-white bgc-primary600 --hover-bgc-primary700 --focus-outline-none --focus-bxs-0px-0px-0px-3px-primary500/3 tn-all tdu-0.2s ">Sign In</button> <p class=" fs-14px c-gray500 ta-center m-0 "> Don't have an account? <a class="c-primary600 td-none --hover-c-primary700" href="#">Sign up</a> </p> </form>

Dark Mode Toggle Pattern

<html class="dark"> <body> <div class=" bgc-white dark-[bgc-gray900,c-white] tn-all tdu-0.3s "> <h1 class=" c-gray900 dark-c-white fs-32px fw-700 ">Hello World</h1> <p class=" c-gray600 dark-c-gray400 fs-16px lh-1.6 ">Welcome to AliasCSS</p> <button class=" bgc-gray100 c-gray900 dark-[bgc-gray800,c-white,b-1px-s-gray700] p-8px-16px br-8px b-1px-s-gray200 fs-14px fw-500 cur-pointer --hover-bgc-gray200 dark---hover-bgc-gray700 tn-all tdu-0.15s ">Toggle</button> </div> </body> </html>

<html> <head> <style> :root { --bg: #ffffff; --fg: #111827; --surface: #f9fafb; --border: #e5e7eb; --primary: #0ea5e9; } @media (prefers-color-scheme: dark) { :root { --bg: #0f172a; --fg: #f8fafc; --surface: #1e293b; --border: #334155; --primary: #38bdf8; } } </style> </head> <body> <div class="bgc--bg c--fg b-1px-s--border p-24px br-12px"> <h1 class="c--fg fs-32px fw-700">Hello World</h1> <p class="c--fg/7 fs-16px">Adapts to system color scheme automatically.</p> <button class="bgc--primary c-white p-10px-20px br-8px bn cur-pointer"> Click Me </button> </div> </body> </html>

Animated Loading Spinner

<div keyframes-spin="@0-tf-r-0deg @100-tf-r-360deg" class=" w-40px h-40px br-50% b-4px-s-gray200 bt-4px-s-primary500 an-spin adu-0.8s atf-linear aici " ></div>

Skeleton Loading

<div keyframes-shimmer="@0-bgp--100%-0 @100-bgp-100%-0" class=" w-100p h-20px br-4px bg-linear-gradient-90deg-gray200-gray100-gray200 bgs-200%-100% an-shimmer adu-1.5s atf-linear aici " ></div>

Last updated on