Skip to content

Reset & Base

NightCSS ships a modern, minimal reset (Andy Bell school) followed by base styles for headings, forms, and media. Both live inside @layer, and every selector uses :where(), so the entire layer carries zero specificity. Your own unlayered CSS always wins — no !important, no specificity wars.

The reset normalizes the things every page needs:

  • box-sizing: border-box on everything.
  • Zero margins, 100dvh minimum body height, line-height: 1.5.
  • Block, full-width media (img, picture, video, canvas, svg).
  • Form controls inherit the font.
  • overflow-wrap: break-word on headings and paragraphs.
  • list-style: none for lists with role="list".

On top of the reset, base styles give sensible defaults.

Heading two

Body copy with a link, strong text, and inline code.

Headings use the fluid type scale, text-wrap: balance, and a semibold weight. Body text uses the system font stack and text-wrap: pretty.

<h1>Heading one</h1>
<h2>Heading two</h2>
<p>Body copy. NightCSS sets the font, size, line height, and color for you.</p>

Links use the accent color with a thin underline that thickens on hover:

<p><a href="#">A link</a> in a paragraph.</p>

Inline code and code blocks use the monospace stack and a raised surface:

<p>Inline <code>code</code> is styled. Blocks get padding and a background.</p>
<pre><code>const x = 1;</code></pre>

Text inputs, selects, and textareas get padding, a border, and the surface background. Textareas use field-sizing: content, so they grow with their content instead of showing a scrollbar.

<label for="name">Name</label>
<input id="name" type="text" placeholder="Ada Lovelace" />
<label for="note">Note</label>
<textarea id="note" rows="2" placeholder="Grows as you type…"></textarea>
<button type="button">Button</button>

Figures have no default margin, figcaptions are muted and small, and embedded video, audio, and iframe have no border.

::selection uses the accent, and :focus-visible draws a ring using --nc-ring. accent-color is set on form controls, so checkboxes, radios, and ranges follow the accent token.