Nue’s approach to visual design is built on a straightforward principle: CSS is the design language of the web, and it works best when it has full access to the entire document. Rather than scattering styles into component files, JS-in-CSS objects, or utility class strings embedded in markup, Nue keeps all design decisions in global stylesheets. Your HTML stays semantic, your JavaScript stays focused on behavior, and your CSS has the complete picture it needs to apply consistent, cascade-aware design across the whole site.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/nuejs/nue/llms.txt
Use this file to discover all available pages before exploring further.
The three layers
Every Nue project has a clean three-layer architecture:Structure
HTML — semantic markup from Nuemark content and layout modules. No presentational class names, no inline styles.
Logic
JavaScript — pure modules for business logic, data fetching, and state. No style manipulation, no className toggling.
Design
CSS — global stylesheets with design tokens, cascade rules, and responsive layouts. No component scoping.
The @shared/design/ directory
All global design files live in @shared/design/. Nue auto-includes everything in this directory on every page, in alphabetical order within the asset priority system.
Why global CSS over scoped styles
Component-scoped CSS, whether from CSS Modules, styled-components, or Vue’s<style scoped>, solves one problem — style isolation — at the cost of several larger ones.
Scoped styles break the cascade
Scoped styles break the cascade
The CSS cascade is not a bug to be worked around. It is how browsers apply consistent styles across related elements. When every component owns its styles in isolation, you lose the ability to set
h2 styles in one place and have them apply everywhere. You end up overriding the same properties in dozens of component files.Scoped styles duplicate design decisions
Scoped styles duplicate design decisions
A color, font, or spacing value that should be defined once ends up hardcoded — or re-imported from a shared file — in each component that uses it. Global CSS custom properties defined once in
tokens.css are available to every selector in the entire stylesheet without any import.Scoped styles hide the design system
Scoped styles hide the design system
When a designer wants to understand the visual language of a site built with scoped styles, they must read dozens or hundreds of component files. A global design system in
@shared/design/ is a single, readable source of truth.Scoped styles couple markup to style
Scoped styles couple markup to style
CSS-in-JS and utility-first approaches embed design decisions in the markup. A
className="text-sm font-medium text-gray-700 hover:text-gray-900" string in JSX is a style description masquerading as a class attribute. Changing the design requires changing the markup.Design tokens and CSS custom properties
CSS custom properties are Nue’s primary mechanism for design tokens. They provide the flexibility of variables with the full power of the cascade — a child element can override a token for its subtree without affecting the rest of the page.--color-text custom property defined in .hero cascades to all children of that element. Any component inside a hero that uses color: var(--color-text) automatically gets white text, without any conditional logic in the component itself.
Theming with custom properties
To support multiple themes — brand variations, customer whitelabels, or seasonal changes — define a base set of tokens and override them per theme:App-level style scoping
Even without component-scoped styles, you can scope styles to a specific app or section of your site by adding styles to the app directory:dashboard.css is in the dashboard/ directory (not in @shared/), Nue’s dependency resolver includes it only in pages that belong to that app.
Design-first development
Nue’s architecture supports a workflow where design is built before components. You can create a complete, responsive design system in CSS — with tokens, type scale, layout rules, and component styles — and then write HTML content that picks up that design automatically.Define tokens
Write
tokens.css with all design decisions as custom properties. Colors, spacing, type scale, radii, shadows.Build the type system
Write
typography.css using only the semantic tokens. Define styles for h1–h6, p, a, blockquote, code, ul, ol, table.Define layout rules
Write
layout.css for page structure — header, main content width, sidebar, footer, responsive breakpoints.