Theme & Styling
Know when to edit page CSS, shared design-system CSS, tokens, dark mode, and the optional UI release.
On this page 5
What you will learn
- Choose the correct stylesheet.
- Change theme tokens safely.
- Avoid unnecessary CDN releases.
Two CSS layers
app/globals.css is the canonical shared Nexus UI design system. It contains tokens and reusable primitives used across pages.
app/template.css is loaded afterward and contains template-specific page layouts and targeted overrides. New page styling normally belongs here.
text
app/globals.css -> shared tokens and reusable UI primitives
app/template.css -> application pages and local layout rulesUse existing tokens
Build new surfaces from semantic variables so light mode, dark mode, and custom primary colors continue to work.
css
.report-card {
border: 1px solid var(--border);
background: var(--surface);
color: var(--text);
}
.report-card p {
color: var(--muted);
}Theme persistence
Theme and layout preferences are bootstrapped in app/layout.tsx before the page paints, then managed by the application shell. Storage failures fall back to safe defaults.
- Test light, dark, and system modes.
- Test every supported primary color.
- Confirm no light flash before dark mode loads.
- Keep focus indicators visible in every theme.