The CSS foundationin one file.

No config, no JavaScript, no build step.

gzip
13.0 KB
dependencies
0
modules
6
licence
MIT

Same markup. Two browsers.

The left side is the browser default. The right side is the same HTML after one import and a few lines of your own CSS.

index.htmllive
Browser defaultNo stylesheet
NightCSS + your CSSOne import, your rules

Drag the divider, or focus it and use the arrow keys, to compare the two renderings.

The layer under your CSS.

Five layers in one file. Unlayered CSS — yours — always wins.

  1. your CSSunlayered · always wins
  2. UtilitiesSpacing, flex, grid, type, colour, borders, motion.9.7 KB
  3. Layoutcontainer, grid, stack, cluster and four more.0.9 KB
  4. BaseHeadings, links, code, tables, forms, media.0.8 KB
  5. TokensColour, type, space, radius, shadow, motion.1.7 KB
  6. ResetBox model, margins, media, forms.0.3 KB

Every value is a variable.

225°
4px
16px
55
Reset
--nc-text-3xl
Tokens
--nc-text-xl
Base
--nc-text-lg
Body copy
--nc-text-base
Small print
--nc-text-sm
Your :root
:root {
  --nc-accent: light-dark(oklch(48% 0.16 225), oklch(75% 0.12 225));
  --nc-radius-md: 4px;
  --nc-space-4: 16px;
  --nc-text: light-dark(oklch(23% 0 0), oklch(76.4% 0 0));
  --nc-text-muted: light-dark(oklch(42% 0 0), oklch(60.6% 0 0));
}
Read the design token reference

The bundle, module by module.

13.0KB gzip
  • reset.css0.3 KB
  • tokens.css1.7 KB
  • base.css0.8 KB
  • layout.css0.9 KB
  • utilities.css9.7 KB

Import one module and the rest never reaches the browser.

Open the build script

All the numbers
The bundle, module by module.
ModuleRawgzipbrotligzip bar
reset.css0.50.30.2
tokens.css5.31.71.4
base.css2.40.80.6
layout.css3.50.90.6
utilities.css73.39.75.9
nightcss.css84.913.08.3
Source tree
src/
├── reset.css
├── tokens/          8 files
├── base/            3 files
├── layout/          8 files
├── utilities/      12 files + generated
├── core.css
├── full.css
└── index.css

The widgets were already there.

<dialog>

Dialog pattern

Focus, Escape and the backdrop come from the browser.

<details>

Details pattern

What is in the reset?

Box-sizing, margins, media and form normalization. It is 0.3 KB gzip.

A summary and a disclosure. No JavaScript, no aria-expanded to maintain.

:has()

The :has() pattern

Off

The card reacts to its own checkbox. No class toggling in script.

popover

Popover pattern

A popover opens above the page with one attribute. Light dismiss is built in.

All four are in the browser. NightCSS only sets the baseline.

Open the native-pattern guides

Between a reset and a framework.

NightCSS normalizes like a reset, ships tokens and layout like a framework, and leaves components to you.

Between a reset and a framework.
FoundationBuildJavaScriptTokensLayersContainer queriesgzip
Tailwind CSSconfig or CDN—theme configyesyes~3–15 KB, used classes
Bootstrap—requiredCSS variables——~46 KB, CSS + JS
Pico CSS—optionalCSS variablesyes—~9 KB
Open Props——--*——~14 KB
NightCSS——--nc-*yesyes13.0 KB

Sizes are approximate gzip for the latest major versions; NightCSS is measured for its lean default (the full bundle is 23.1 KB).

Read the installation guide