Skip to main content

CSS Architecture

The theme uses a three-layer CSS architecture. Each layer has a clear responsibility and loads in a deterministic order.

Summary

Styles are organized into three layers: base (universal resets and utilities), block (structural layout for Nova blocks), and preset (visual identity — colors, shapes, depth, and motion). The theme also generates CSS custom properties from the preset configuration at build time.

Three-Layer Model

Base Layer

Universal styles shared across all presets and components.

FilePurpose
reset.cssCSS reset for consistent cross-browser baseline.
grid.cssResponsive grid system using CSS custom properties.
accessibility.cssFocus styles, screen reader utilities, reduced motion.
utilities.cssShared structural patterns for reusable UI elements.

Block Layer

Structural styles for the 10 Nova blocks. No colors, no shadows, no preset-specific values. Only layout, spacing, and responsive behavior.

DirectoryPurpose
styles/blocks/app-market-download/Download button layout.
styles/blocks/blog-preview/Blog preview grid layout.
styles/blocks/features/Feature grid layout.
styles/blocks/frame/Captioned figure layout.
styles/blocks/hero/Hero section layout.
styles/blocks/install-strip/Install strip layout.
styles/blocks/spotlight/Spotlight section layout.
styles/blocks/stats/Stats grid layout.
styles/blocks/terminology/Terminology tooltip layout.
styles/blocks/typewriter/Typewriter animation layout.

Preset Layer

Visual identity for each preset. Each preset directory contains its own preset.css, block overrides, and navbar/footer variant styles.

text
styles/presets/{envoy|foundry|lantern|marshal|sentinel|signal}/
├── preset.css                     (root variables and base overrides)
├── blocks/                        (per-block visual overrides)
│   ├── hero/style.css
│   ├── features/style.css
│   └── ...
└── theme/                         (Docusaurus theme component overrides)
    ├── Navbar/{Bridge|Canopy|Compass|Monolith}/style.css
    ├── Footer/{Commons|Embassy|Launchpad|Ledger}/style.css
    ├── CodeBlock/style.css
    ├── DocSidebar/style.css
    └── ...

CSS Load Order

The theme loads stylesheets in this exact sequence at page mount:

  1. Global resetsreset.css, grid.css, accessibility.css, utilities.css
  2. Generated CSSnova-generated.css (CSS custom properties from preset config)
  3. Shared block styles — structural layout for all 10 Nova blocks
  4. Shared theme styles — base styles for 70+ Docusaurus theme components
  5. Preset identity CSSpreset.css for the active preset
  6. Preset block overrides — visual overrides per block per preset
  7. Preset navbar variant — styles for the active navbar variant
  8. Preset footer variant — styles for the active footer variant

Load Order Matters

Later stylesheets override earlier ones at the same specificity. The preset layer loads last so it can override block and theme styles without !important.

CSS Custom Properties

The theme generates CSS custom properties from the preset configuration at build time. These properties are written to nova-generated.css and available globally.

Colors

The two brand colors (primary and secondary) each generate 11 shades. The other four categories (text, border, warning, danger) emit a single base token per category plus a small set of derived color-mix tokens.

PropertyExample ValueDescription
--nova-color-primary-50#fff7edLightest shade
--nova-color-primary-100#ffedd5
--nova-color-primary-200#fed7aa
--nova-color-primary-300#fdba74
--nova-color-primary-400#fb923c
--nova-color-primary-500#f97316
--nova-color-primary-600#ea580cBase color
--nova-color-primary-700#c2410c
--nova-color-primary-800#9a3412
--nova-color-primary-900#7c2d12
--nova-color-primary-950#431407Darkest shade

The same shade pattern applies to --nova-color-accent-* (the secondary brand color is emitted under the accent namespace for backward compatibility with existing preset CSS).

Non-brand category tokens include --nova-color-text (plus -muted, -soft, -inverse), --nova-color-border (plus -subtle), --nova-color-surface-raised, --nova-color-warning-500 (plus -400 and -bg), and --nova-color-danger-500 (plus -400 and -bg). The full list and how each is derived is documented in Color Pipeline.

Fonts

PropertyExample Value
--nova-font-display'Plus Jakarta Sans', sans-serif
--nova-font-body'Inter', sans-serif
--nova-font-code'Fira Code', monospace

Shape

Radius is set by the radius config (sharp, rounded, pill):

Propertysharproundedpill
--nova-shape-radius00.5rem9999px

Density is set by the density config (compact, comfortable, spacious):

Propertycompactcomfortablespacious
--nova-shape-padding0.5rem1rem1.5rem
--nova-shape-gap0.25rem0.5rem1rem

Depth

Propertyflatelevatedglass
--nova-depth-card-shadownone0 4px 6px …, 0 2px 4px …0 4px 30px …
--nova-depth-card-border1px solid var(--nova-color-border)none1px solid rgba(255,255,255,0.18)
--nova-depth-card-backdropnonenoneblur(5px)

Code block depth follows the same pattern with --nova-depth-code-shadow and --nova-depth-code-border (flat, bordered, elevated).

Motion

Speed is set by the speed config (none, subtle, normal, expressive):

Propertynonesubtlenormalexpressive
--nova-motion-duration0ms150ms200ms300ms

Toggles are CSS numeric booleans (0 or 1):

PropertyDescription
--nova-motion-staggered-revealsEnable staggered animations.
--nova-motion-hover-effectsEnable hover transitions.

Grid

Responsive grid tokens with three breakpoints:

PropertyBase480px+768px+
--nova-grid-gutter16px20px24px
--nova-grid-padding16px20px24px

Values shown for comfortable density. compact uses smaller values; spacious uses larger values.