Skip to content

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 ​

Rules ​

  • Use semantic utilities such as bg-default, bg-muted, text-muted, text-highlighted and border-default. They follow dark mode.
  • Use the named token utilities, for example gap-base, p-card, h-control-md, shadow-overlay and z-overlay.
  • Do not write raw palette classes such as zinc or white. 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 in structure.css, or add an @utility in app.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:theme after 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/base import @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 ​

  1. Create resources/css/themes/name.css.
  2. Put the overrides in one [data-theme='name'] block, and the dark values in a .dark[data-theme='name'] block.
  3. Put only variable overrides in the file. No component selectors and no @apply.
  4. Import the file in app.css.

Add a wrapper ​

  1. Create components/base/name/AppName.vue that wraps the Nuxt UI component. Expose its props and slots, and pass data-testid through.
  2. Export it from the folder index.ts.
  3. Add the visual rules to its section in tools/ui/theme.js, in alphabetical order.
  4. 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.