Design tokens
Browse runtime CSS variables and consume source-derived token data from JavaScript, JSON, or TypeScript.
Design tokens
All framework decisions are exposed as CSS custom properties. Color tokens may be remapped by a theme; typography, spacing, radius, elevation, container, and motion tokens are shared. Compare every palette and resolved color value in the complete theme color reference.
Override semantic tokens
Theme a subtree by redefining public semantic variables on its boundary. Components inside consume the new values automatically.
Semantic override
The button and badge inherit the local primary color.
<section class="campaign" style="--bs-color-primary: #7c3aed; --bs-color-primary-hover: #8b5cf6;">
<span class="bs-badge bs-badge-primary">Customized</span>
<button class="bs-btn bs-btn-primary" type="button">Continue</button>
</section>Semantic first
Prefer --bs-color-primary and other semantic variables over raw palette tokens when customizing components.
Scope
Override on :root for the whole application, a theme attribute for one palette, or a component ancestor for a local treatment.
Fallbacks
Keep every required state token—default, hover, active, focus, border, and text—legible in both light and dark contexts.
Use tokens in build tools and design tools
Boobstrap v0.5 generates JavaScript, JSON, and TypeScript declarations from the same CSS source used by the framework. Import the ES module when application or build code needs named tokens and modes collections; import JSON when a tool consumes data without executing a module.
import tokenArtifact, { modes, tokens } from "@boobstrap/boobstrap/tokens";
import tokenJson from "@boobstrap/boobstrap/tokens.json" with { type: "json" };
const primary = tokens.color.primary.$value;
const lightOverrides = modes['[data-bs-theme="light"]'];
console.log(tokenArtifact.tokens === tokens); // true
console.log(tokenJson.tokens.color.primary.$value);Token artifact contract
| Export | Shape | Use it for |
|---|---|---|
default | { tokens, modes } | Passing the complete source-derived artifact to another tool. |
tokens | Grouped token records with $value and $extensions | Reading base values and their originating --bs-* CSS variable names. |
modes | CSS-selector keys mapped to variable overrides | Inspecting light mode, palette, and radius remaps without resolving CSS in a browser. |
tokens.json | $schema and $description metadata plus tokens and modes | Design-token pipelines, documentation generators, and non-JavaScript consumers that need the complete generated envelope. |
var() aliases become DTCG-style references such as {brand.500}; CSS-native expressions such as gradients, shadows, clamp(), and font stacks remain lossless strings. See TypeScript for the exported declaration shape.Browse runtime CSS variables
The searchable inventory below is generated from the exact framework stylesheet installed by this site. It is the authoritative runtime API for theming in the browser.
Palette10
--bs-white--bs-brand-300--bs-brand-400--bs-brand-500--bs-brand-600--bs-brand-700--bs-plum-700--bs-plum-800--bs-plum-900--bs-plum-950Semantic colors19
--bs-color-background--bs-color-surface--bs-color-surface-raised--bs-color-surface-hover--bs-color-text--bs-color-text-muted--bs-color-text-subtle--bs-color-primary--bs-color-primary-hover--bs-color-primary-active--bs-color-primary-contrast--bs-color-focus-ring--bs-color-success--bs-color-warning--bs-color-danger--bs-color-info--bs-color-border--bs-color-border-strong--bs-color-control-backgroundTypography17
--bs-font-sans--bs-font-display--bs-font-mono--bs-font-size-xs--bs-font-size-sm--bs-font-size-md--bs-font-size-lg--bs-font-size-xl--bs-font-size-2xl--bs-font-size-3xl--bs-font-size-4xl--bs-font-size-5xl--bs-font-size-6xl--bs-line-height-tight--bs-line-height-heading--bs-line-height-body--bs-line-height-codeSpacing14
--bs-space-0--bs-space-1--bs-space-2--bs-space-3--bs-space-4--bs-space-5--bs-space-6--bs-space-8--bs-space-10--bs-space-12--bs-space-16--bs-space-20--bs-space-24--bs-space-32Radius7
--bs-radius-xs--bs-radius-sm--bs-radius-md--bs-radius-lg--bs-radius-xl--bs-radius-2xl--bs-radius-pillEffects5
--bs-shadow-sm--bs-shadow-md--bs-shadow-lg--bs-shadow-brand--bs-gradient-brandContainers5
--bs-container-sm--bs-container-md--bs-container-lg--bs-container-xl--bs-container-2xlBreakpoints5
--bs-breakpoint-sm--bs-breakpoint-md--bs-breakpoint-lg--bs-breakpoint-xl--bs-breakpoint-2xlZ-index10
--bs-z-dropdown--bs-z-sticky--bs-z-fixed--bs-z-navbar-backdrop--bs-z-navbar--bs-z-popover--bs-z-tooltip--bs-z-toast--bs-z-dialog-backdrop--bs-z-dialogControl sizes4
--bs-control-size-sm--bs-control-size-md--bs-control-size-lg--bs-control-size-xlButton sizes3
--bs-btn-size-sm--bs-btn-size-md--bs-btn-size-lgComponent customization0
Overlay1
--bs-overlay-backdropMotion5
--bs-duration-fast--bs-duration-normal--bs-duration-slow--bs-ease-standard--bs-ease-emphasizedScrollbars4
--bs-scrollbar-size--bs-scrollbar-track--bs-scrollbar-thumb--bs-scrollbar-thumb-hover