Skip to content

Tailwind

Install tailwindcss, @nightwire/css, and @nightwire/tailwind. Process a stylesheet with Tailwind’s Vite plugin or CLI:

@import 'tailwindcss';
@import '@nightwire/tailwind';

The Nightwire entry adds tokens, fonts, and base styles, not nw-* components. If you already import the full CSS package, use @nightwire/tailwind/theme.css in place of @nightwire/tailwind to add just the mappings and utilities.

What changes Examples
Semantic color bg-canvas, bg-panel, text-fg, text-fg-muted, ring-ring, bg-primary/20
Intent pairs bg-primary text-on-primary, bg-danger-soft
Raw palette color bg-nw-surface0, text-nw-iris
Type and geometry font-display, font-mono, text-2xl, rounded-lg, p-4, gap-2, h-(--nw-control-md)
Motion and elevation ease-standard, animate-fade-in, shadow-md

The theme maps utilities to --nw-* values with @theme inline, so semantic utilities follow a nested flavor or accent scope without recompiling. For custom CSS, use the --nw-* variables directly.

The abyss:, nocturne:, twilight:, and lumen: variants match an explicit [data-flavor] scope. dark: matches the three dark flavors; light: matches Lumen. These are ancestor selectors: an outer dark flavor still matches inside a nested Lumen scope. For adaptive colors, prefer semantic utilities that resolve at the element itself.

Utility Effect
cut, wire, wire-glow Chamfer, gradient edge, and edge bloom
glow-sm, glow-md, glow-lg, glow-<color>, text-glow Glow strength, color, and text treatment
scanlines, grid-bg, glitch Overlay texture, circuit grid, and a hover or focus effect
Cut corners with a wire edge
<div class="cut wire p-4 text-fg">Cut corners with a wire edge</div>

Set --nw-fill to change the fill on cut or wire surfaces. cut uses ::before and scanlines uses ::after. Put grid-bg on a separate element from cut or wire so their backgrounds do not compete.

Use the Nightwire merger when a component accepts overrides. It understands Nightwire’s custom utility groups, not just standard Tailwind classes.

import { cn } from '@nightwire/tailwind/merge'
cn('bg-canvas p-4', 'bg-panel') // 'p-4 bg-panel'
cn('glow-sm glow-primary', 'glow-lg') // 'glow-primary glow-lg'