Skip to content

Theme builder ​

Pick a neutral scale, a primary color and a radius. See them on a full page, then copy the CSS.

Every combination keeps text at 4.5:1 and focus rings at 3:1 against their backgrounds, in light and dark mode. Switch the site theme to see both.

Base color
Primary color
Radius

Your CSS

Save it as theme.css and load it after tokens.css.

/* Bootcn theme: zinc base, neutral primary, 0.5rem radius.
   Load after tokens.css. */
:root,
[data-bs-theme='light'] {
  --bootcn-background: #ffffff;
  --bootcn-foreground: #09090b;
  --bootcn-muted: #f4f4f5;
  --bootcn-muted-foreground: #6f6f78;
  --bootcn-accent: #f4f4f5;
  --bootcn-accent-foreground: #18181b;
  --bootcn-secondary: #f4f4f5;
  --bootcn-secondary-foreground: #18181b;
  --bootcn-primary: #18181b;
  --bootcn-primary-foreground: #fafafa;
  --bootcn-border-color: #e4e4e7;
  --bootcn-input: #e4e4e7;
  --bootcn-ring: #71717a;
  --bs-body-bg-rgb: 255, 255, 255;
  --bs-body-color-rgb: 9, 9, 11;
  --bs-emphasis-color-rgb: 9, 9, 11;
  --bs-secondary-color-rgb: 111, 111, 120;
  --bs-secondary-bg-rgb: 244, 244, 245;
  --bs-tertiary-color-rgb: 111, 111, 120;
  --bs-tertiary-bg: #fafafa;
  --bs-tertiary-bg-rgb: 250, 250, 250;
  --bs-primary-rgb: 24, 24, 27;
  --bs-link-color-rgb: 9, 9, 11;
  --bs-link-hover-color-rgb: 9, 9, 11;
  --bs-focus-ring-color: rgba(113, 113, 122, 0.5);
  --bs-border-radius-sm: 0.25rem;
  --bs-border-radius: 0.375rem;
  --bs-border-radius-lg: 0.5rem;
  --bs-border-radius-xl: 0.75rem;
}

[data-bs-theme='dark'] {
  --bootcn-background: #09090b;
  --bootcn-foreground: #fafafa;
  --bootcn-muted: #27272a;
  --bootcn-muted-foreground: #a1a1aa;
  --bootcn-accent: #27272a;
  --bootcn-accent-foreground: #fafafa;
  --bootcn-secondary: #27272a;
  --bootcn-secondary-foreground: #fafafa;
  --bootcn-primary: #fafafa;
  --bootcn-primary-foreground: #18181b;
  --bootcn-border-color: #27272a;
  --bootcn-input: #3f3f46;
  --bootcn-ring: #a1a1aa;
  --bs-body-bg-rgb: 9, 9, 11;
  --bs-body-color-rgb: 250, 250, 250;
  --bs-emphasis-color-rgb: 250, 250, 250;
  --bs-secondary-color-rgb: 161, 161, 170;
  --bs-secondary-bg-rgb: 39, 39, 42;
  --bs-tertiary-color-rgb: 161, 161, 170;
  --bs-tertiary-bg: #18181b;
  --bs-tertiary-bg-rgb: 24, 24, 27;
  --bs-primary-rgb: 250, 250, 250;
  --bs-link-color-rgb: 250, 250, 250;
  --bs-link-hover-color-rgb: 250, 250, 250;
  --bs-focus-ring-color: rgba(161, 161, 170, 0.5);
}

Released under the MIT License. Not affiliated with Bootstrap or shadcn/ui.