Introduction
AliasCSS is a CSS meta language for AI and humans. Every class name is one native CSS declaration, so anyone who knows CSS can read it, and any model can write it.
A class is a declaration
In AliasCSS you don’t learn a vocabulary of utility names. You write the CSS declaration you already know, as a class:
@md--hover-text-decoration-underline
- scope where it applies
- selector when it applies
- property any CSS property
- value written as in CSS
@layer md {
@media (min-width: 768px) {
.\@md--hover-text-decoration-underline:hover {
text-decoration: underline;
}
}
}The property and value always come last. Anything in front of them says where or when the declaration applies: a media query, a layer, a state, a parent. Properties can be written in full (background-color-red) or with a short alias (bgc-red), and values are written the way CSS writes them.
<button class="d-inline-flex aic g-8px p-8px-16px br-8px b-0 bgc-blue c-white fs-14px cursor-pointer --hover-bgc-navy">
Save changes
</button>Generated CSS
.d-inline-flex {
display: inline-flex;
}
.aic {
align-items: center;
}
.g-8px {
gap: 8px;
}
.p-8px-16px {
padding: 8px 16px;
}
.br-8px {
border-radius: 8px;
}
.b-0 {
border: 0;
}
.bgc-blue {
background-color: blue;
}
.c-white {
color: white;
}
.fs-14px {
font-size: 14px;
}
.cursor-pointer {
cursor: pointer;
}
.--hover-bgc-navy:hover {
background-color: navy;
}Why a meta language
A meta language describes another language. AliasCSS describes CSS, one declaration per class, with a small grammar for everything around the declaration. That gives it two kinds of readers.
For people. Nothing to memorise beyond CSS itself. letter-spacing-0.02em, aspect-ratio-16/9 and grid-template-columns(repeat(3,1fr)) mean exactly what they say. New CSS features work the day browsers ship them, because AliasCSS passes properties and values through instead of keeping a list.
For models. A language model already knows CSS from the web’s specs and MDN. AliasCSS asks it to apply that knowledge with one predictable rule, so the classes it writes are right the first time, and a wrong one is easy to spot. The AI page has a reference file (llms.txt) and an agent skill that teach the remaining grammar in one read.
What comes with it
- A compiler that runs as a CLI or a Vite step and writes one CSS file with only the classes you used.
- A browser script for prototypes: it compiles classes on the page as you write them.
- Theme-aware color tokens that switch between light and dark with no extra classes.
- Exports (
--as-name) that turn a list of classes into one named class, right in the markup. - Keyframes in HTML: an animation is an attribute on an element.
- An optional component library (
x-button,x-card,x-dialog…) built with AliasCSS itself, as an example of a design system you can extend or replace.
Where to go next
- Try it in the playground, right in your browser.
- Install it: the browser script for quick pages, the CLI for real projects.
- Read how classes work. It’s the whole grammar on one page.
- Keep the cheat sheet open while you write.