Loading...
Loading...
Work with Bootstrap 6's color system in Sass and CSS. Use when customizing colors, adding or overriding theme colors, working with color modes, or using the color scales, semantic tokens, and theme classes.
npx skill4agent add twbs/bootstrap bootstrap-color-systemoklch()scss/_colors.scssoklch()$colors025975color-mix()--blue-500--red-200:rootscss/_theme.scssprimarydangerscss/_root.scss--<name>-<role>--danger-bg-subtlescss/helpers/_theme-colors.scss.theme-<name>@layer helpers--<name>-<role>--theme-<role>--theme-*bootstrap-componentoklch()$blue: oklch(60% 0.24 240) !default;$white$black$colorsdefaults()$tint-colorvar(--white)025 050 100 200 300 400$shade-colorvar(--black)600 700 800 900 950 975$color-mix-spacelab$colors$colors@use "bootstrap/scss/bootstrap" with (
$colors: (
"slate": oklch(55% 0.04 250),
)
);$color-tints$color-shades$color-tokensvar(--white)var(--black)color-mix()lab()$theme-colorsscss/_theme.scssprimaryaccentsuccessdangerwarninginfoinversesecondary| Role | What it's for |
|---|---|
| The raw brand color the rest is derived from |
| Solid background, e.g. a solid button or badge |
| Tinted surface for alerts, subtle buttons, callouts |
| One step stronger than subtle |
| Text on a subtle surface |
| Higher-contrast text on a subtle surface |
| Text and icons sitting on |
| Borders on subtle surfaces |
| Focus outline color |
light-dark(…)var()"danger": (
"base": var(--red-500),
"fg": light-dark(var(--red-600), var(--red-400)),
"bg-subtle": light-dark(var(--red-100), var(--red-900)),
"border": light-dark(var(--red-300), var(--red-600)),
"contrast": var(--white)
),--danger-fg:root, :host.theme-danger--theme-fg--theme-bg-subtle--theme-*.theme-reset--theme-*initialprimarysuccessdanger$theme-colorsscss/_theme.scss$theme-bgs--bg-body--bg-1--bg-4--bg-white--bg-black--bg-transparent$theme-fgs--fg-body--fg-1--fg-4$theme-borders--border-body--border-subtle--border-muted--border-emphasizedvar(--theme-bg-subtle, var(--bg-1))var(--theme-border, var(--border-color))--border-color$root-tokens--border-*$theme-colorsdefaults()light-dark()color-scheme:root, :hostcolor-scheme: light dark[data-bs-theme="dark"][data-bs-theme="light"]color-schemelight-dark()light-dark()// Non-color values can't go through light-dark()
@include color-mode(dark, $root: true) {
--shadow-strength: 2.4;
}color-mode($mode, $root)$color-mode-type"media-query"@media (prefers-color-scheme: …)"data"[data-bs-theme="…"]color-scheme($name)[data-bs-theme="blue"]defaults()$colors$color-tokens$root-tokens$theme-colors$theme-bgs$theme-fgs$theme-borders$*-tokensnull@use "bootstrap/scss/bootstrap" with (
$blue: oklch(58% 0.21 250)
);$theme-colorsdefaults()primarysuccessdanger@use "bootstrap/scss/bootstrap" with (
$theme-colors: (
"brand": (
"base": var(--indigo-500),
"fg": light-dark(var(--indigo-600), var(--indigo-400)),
"fg-emphasis": light-dark(var(--indigo-800), var(--indigo-300)),
"bg": var(--indigo-500),
"bg-subtle": light-dark(var(--indigo-100), var(--indigo-900)),
"bg-muted": light-dark(var(--indigo-200), var(--indigo-800)),
"border": light-dark(var(--indigo-300), var(--indigo-600)),
"focus-ring": light-dark(color-mix(in oklch, var(--indigo-500) 50%, var(--bg-body)), color-mix(in oklch, var(--indigo-500) 75%, var(--bg-body))),
"contrast": var(--white)
)
)
);--theme-*@layer helpers {
.theme-brand {
--theme-base: var(--purple-500);
--theme-bg: var(--purple-500);
--theme-bg-subtle: light-dark(var(--purple-100), var(--purple-900));
--theme-fg: light-dark(var(--purple-600), var(--purple-400));
--theme-border: light-dark(var(--purple-300), var(--purple-600));
--theme-contrast: var(--white);
}
}.theme-brand--brand-*$theme-colors.bg-brandvar(--brand-bg)/* Global — repeat on :host if you adopt the stylesheet in a shadow root */
:root,
:host {
--bs-primary-bg-subtle: #eef2ff;
}
/* One subtree */
.marketing-hero {
--bs-theme-bg-subtle: #eef2ff;
}--primary-bg-subtle--bs---bs-*scss/_theme.scsstheme-color-values($role)theme-color-refs($role)var(--<name>-<role>)theme-token-refs($map, $prefix)theme-opacity-values($var, $fallback)color-mix()transparentcolor-contrast($background)scss/_functions.scssvar()contrast$theme-colors.fg-primary.fg-emphasis-primary.fg-contrast-primary.bg-primary.bg-subtle-primary.bg-muted-primary.border-primary.border-subtle-primary.bg-1.bg-4.fg-1.fg-4.border-subtle.fg-50.bg-70.border-30.theme-*npm run css-lintnpm run cssdist/css/bootstrap.css--bs-primary-bg-subtle--bs-slate-500data-bs-theme="dark"data-bs-theme="light"contrastbgfgbg-subtle$colors$theme-colors.theme-*npm run docs-build