Introduction
NibCSS turns short `nib="…"` attributes into a real, deterministic stylesheet — in plain HTML and in every major framework.
Write CSS as HTML attributes
One attribute, real CSS. No class names to invent, no stylesheet to keep in sync, the same output in every framework.
<button nib="d=inline-flex; ali=center; g=8px; p=10px 18px; bdrd=10px; bd=none; cur=pointer;
ftw=600; cl=#fff; bgc=#4F52D9; ts=all .15s;
hover:bgc=#3A3DBF; hover:tf=translateY(-1px); active:tf=translateY(0)">
Save changes
</button>What NibCSS is#
NibCSS is a styling engine. You write CSS declarations directly on the element, in a short
key=value form, and NibCSS compiles each rule into a real class with real CSS:
bgc=#4F52D9becomesbackground-color: #4F52D9hover:bgc=#3A3DBFbecomes a:hoverrulemd:p=24pxbecomes a rule inside@media (min-width: 768px)
The attribute stays readable, and what reaches the browser is an ordinary stylesheet — no inline styles, no style objects, no specificity fights.
Every style an element has is on the element. No jumping between a template and a stylesheet.
Hover, focus, media queries, dark mode and pseudo-elements — things inline style can never do.
p=16px is always .nib-jbmcpl, in every file, build and machine. Output is cache- and SSR-safe.
With a bundler, static attributes are extracted to a .css file at build time — or rewritten straight into class.
Plain HTML, React, Next.js, Vue, Nuxt, Angular, Svelte, Astro, and server frameworks through the CLI.
Typos are caught with “did you mean?” suggestions, the file and line, and values that would have worked.
Who it is for#
- Product teams who want a consistent design system (tokens and reusable recipes) without a component library.
- Framework authors and prototypers who want styles next to markup with no build step at all (CDN).
- Server-rendered apps — Rails, Django, Laravel, PHP — through a standalone CLI that writes one
nib.css.
A 20-second tour#
<!-- Layout, spacing, colours, states and breakpoints — all in one place -->
<article nib="card; d=grid; g=16px; md:gtc=120px 1fr; ali=center">
<img nib="w=100%; asp=1; bdrd=12px; objf=cover" src="/avatar.jpg" alt="">
<div>
<h3 nib="m=0; fts=18px; ftw=700">Ada Lovelace</h3>
<p nib="mt=4px; cl=$color.ink-muted; dark:cl=#94a3b8">First programmer</p>
<a nib="btn-primary; mt=12px" href="/profile">View profile</a>
</div>
</article>In this snippet:
cardandbtn-primaryare component recipes you define once in the config.$color.ink-mutedis a design token.md:anddark:are modifiers — responsive and dark-mode variants.gtc,asp,objfare shorthands forgrid-template-columns,aspect-ratioandobject-fit.
Every concept has its own page. If you are new, follow them in order from the sidebar, or start with the course.