Getting Started
NightCSS is a drop-in CSS foundation. One <link> or @import gives you a modern
reset, sensible defaults for headings, forms, and media, and a full set of --nc-*
design tokens — with light and dark themes that follow the operating system.
It sits between a bare reset and a full framework: more than a reset (tokens, theming, utilities, layout primitives) and less than Bootstrap (no components, no JavaScript, no build step).
Add NightCSS
Section titled “Add NightCSS”The fastest path is a single <link> in your page:
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/nightcss@2/dist/nightcss.min.css">Or install from npm and import it:
npm install nightcss@import "nightcss";That import is the lean default: everything except breakpoint classes. If you use
p-md-4, d-lg-none, or any other breakpoint variant, add the responsive file
after it:
@import "nightcss";@import "nightcss/utilities/responsive";Or take the full bundle with @import "nightcss/full";. See
Installation for the CDN versions of both.
What you get
Section titled “What you get”Here is the same markup before and after NightCSS:
<h1>NightCSS</h1><p>A paragraph with <a href="#">a link</a>, <strong>strong text</strong>,and <code>inline code</code>.</p>
<button type="button">Button</button><input type="text" placeholder="Text input" />Without NightCSS the browser applies its default stylesheet. With NightCSS you get a consistent type scale, the system font stack, semantic color tokens, styled forms and buttons, and a dark theme for free — all at zero specificity, so your own styles always win.
Theming in one line
Section titled “Theming in one line”Every color, space, and radius is a custom property. Re-theme the whole foundation at runtime:
:root { --nc-accent: oklch(45% 0.2 280); --nc-radius-md: 0.75rem;}Read Design Tokens for the full token reference and
Theming for light/dark and data-theme overrides.
Next steps
Section titled “Next steps”- Design Tokens — the
--nc-*system and how to override it. - Utilities — the class reference, grouped by layout, type, colour, surfaces, and motion.
- Layout Primitives —
stack,cluster,sidebar,switcher,cover,frame. - Native Patterns —
<dialog>,popover,<details>,:has(), and friends. - Sass Subpackage — token maps, accessor functions, and mixins for build-time work.