NubiscoUI ships with a complete SCSS token system. Every visual decision, color, spacing, type scale, z-index, field heights, is a CSS custom property derived from typed SCSS maps. You do not need to write SCSS to use it.
How it works
The pipeline has three stages:
- SCSS maps (
src/styles/variables/) define every raw value, color names, type scales, spacing ratios, z-index stacks. _theme.scssiterates those maps and emits a CSS custom property for each entry onto:root.- Your browser resolves the properties at runtime. No rebuild needed to change a value.
Overriding tokens as a consumer
You don't need to touch SCSS. Override CSS custom properties in your own stylesheet:
/* main.css or App.vue <style> */
:root {
/* Rebrand primary color */
--nb-c-primary: #1a56db;
--nb-c-primary-hover: #1e429f;
--nb-c-primary-active: #1c3fa0;
/* Change the base spacing unit (all gaps, field heights scale with it) */
--nb-base-unit: 10px; /* default is 8px */
}That is all. Every component that references --nb-c-primary or --nb-base-unit inherits the change automatically.
Semantic vs. palette tokens
NubiscoUI separates two layers:
Palette tokens: raw color values tied to a named color. Rarely override these directly.
--nb-c-grape-hyacinth-500: #5c35c4 /* auto-generated tint */
--nb-c-grape-hyacinth-600: #4d2aa8 /* darker tint */;Semantic tokens: intent-level tokens that components consume. Override these to rebrand.
--nb-c-primary: var(--nb-c-grape-hyacinth-500) /* references palette */
--nb-c-primary-hover: var(--nb-c-grape-hyacinth-600);Override semantic tokens when you want to change the brand. Override palette tokens when you want to add new colors to the system.
Customising in SCSS
If you import @nubisco/ui/styles directly, you can also override the SCSS maps before the library is compiled:
// Override the $colors map to inject your brand palette
@use '@nubisco/ui/variables' with (
$colors: (
grape-hyacinth: #5c35c4,
// keep the base
your-brand: #1a56db,
// add yours
)
);This gives you the full shade ramp (--nb-c-your-brand-100 through --nb-c-your-brand-900) plus a11y contrast variants: generated automatically from a single hex value.