Design system
The UI uses Nuxt UI behind thin App* wrappers. Every visual value is a token, so a theme can change the look without touching components. Read this page before you change any style.
Where things live
resources/css/structure.cssholds the structure tokens shared by all themes. They cover spacing, sizes, type, radius, layers and motion.resources/css/themesholds one palette file per theme.base.cssis the default.sakura.css,solarized-light.cssandsolarized-dark.cssoverride it.resources/css/app.cssimports the themes and defines the@utilityrules for the control sizes and the toolbar heights.tools/ui/theme.jsis the Nuxt UI preset, with one section per component.resources/js/components/baseholds the wrappers. They hold no classes and no colors.
Rules
- Use semantic utilities such as
bg-default,bg-muted,text-muted,text-highlightedandborder-default. They follow dark mode. - Use the named token utilities, for example
gap-base,p-card,h-control-md,shadow-overlayandz-overlay. - Do not write raw palette classes such as
zincorwhite. Do not use arbitrary values for size, radius, shadow or z-index. - Do not write a variable class such as
gap-(--spacing-base). If a token has no utility, register it instructure.css, or add an@utilityinapp.css. - The preset never changes per theme. It holds no theme name, no raw color and no pixel value. A difference between themes must be a token.
- Run
npm run check:themeafter you edit the preset or the CSS. CI runs it too. - Do not edit a wrapper to change how something looks. Change the preset or a token.
- Only files in
components/baseimport@nuxt/ui. - Icons are full literal names such as
i-hugeicons-cancel-01. Never build a name from parts, because the bundler cannot find it.
Add a theme
- Create
resources/css/themes/name.css. - Put the overrides in one
[data-theme='name']block, and the dark values in a.dark[data-theme='name']block. - Put only variable overrides in the file. No component selectors and no
@apply. - Import the file in
app.css.
Add a wrapper
- Create
components/base/name/AppName.vuethat wraps the Nuxt UI component. Expose its props and slots, and passdata-testidthrough. - Export it from the folder
index.ts. - Add the visual rules to its section in
tools/ui/theme.js, in alphabetical order. - Add a behavior test in
resources/js/tests/components/base.
Check every UI change in the running app, in light and dark mode. The base components README lists the spacing scale and the token families.