Loft for shadcn/ui

Loft is a shadcn/ui theme built around a vivid violet primary color (#783bfc) with vivid purple accents (#d93bfc). The light mode uses a neutral background (#ffffff). Dark mode keeps the vivid violet primary (#783bfc) on a violet-tinted background (#06040b).

Color palette

TokenLightDark
Background
#ffffffwhite
#06040bblack
Foreground
#020104black
#fcfcfdwhite
Card
#fcfcfcsnow
#08050fblack
Card foreground
#000000black
#ffffffwhite
Popover
#ffffffwhite
#06040bblack
Popover foreground
#020104black
#fcfcfdwhite
Primary
#783bfcblueviolet
#783bfcblueviolet
Primary foreground
#ffffffwhite
#ffffffwhite
Secondary
#3b5efcroyalblue
#3b5efcroyalblue
Secondary foreground
#ffffffwhite
#ffffffwhite
Muted
#eceef3whitesmoke
#0c0d13black
Muted foreground
#4b4c4edarkslategray
#b1b2b4darkgray
Accent
#d93bfcmediumorchid
#d93bfcmediumorchid
Accent foreground
#000000black
#000000black
Destructive
#a61008darkred
#ef170bred
Destructive foreground
#fee3e2mistyrose
#ffffffwhite
Border
#e5e7eblavender
#1f2937darkslategray
Input
#e5e7eblavender
#1f2937darkslategray
Ring
#783bfcblueviolet
#783bfcblueviolet

Contrast

WCAG 2 contrast ratios between each background and its foreground color.

Light mode
Text on background20.81:1AAA
Text on card20.54:1AAA
Primary button5.47:1AA
Secondary button4.98:1AA
Muted text7.38:1AAA
Accent5.97:1AA
Destructive6.43:1AA
Dark mode
Text on background19.88:1AAA
Text on card20.18:1AAA
Primary button5.47:1AA
Secondary button4.98:1AA
Muted text9.13:1AAA
Accent5.97:1AA
Destructive4.39:1AA Large

CSS variables

Paste this into your globals.css to use Loft in your shadcn/ui project.

:root {
  --radius: 0.5rem;
  --background: oklch(1 0 180);
  --foreground: oklch(0.078 0.018 301.173);
  --muted: oklch(0.948 0.007 276.062);
  --muted-foreground: oklch(0.415 0.004 276.033);
  --popover: oklch(1 0 180);
  --popover-foreground: oklch(0.078 0.018 301.173);
  --card: oklch(0.992 0 161.565);
  --card-foreground: oklch(0 0 0);
  --border: oklch(0.928 0.006 264.531);
  --input: oklch(0.928 0.006 264.531);
  --primary: oklch(0.552 0.261 289.227);
  --primary-foreground: oklch(1 0 180);
  --secondary: oklch(0.56 0.237 267.796);
  --secondary-foreground: oklch(1 0 180);
  --accent: oklch(0.666 0.28 319.327);
  --accent-foreground: oklch(0 0 0);
  --destructive: oklch(0.46 0.181 29.457);
  --destructive-foreground: oklch(0.937 0.029 21.304);
  --ring: oklch(0.552 0.261 289.227);
  --chart-1: oklch(0.552 0.261 289.227);
  --chart-2: oklch(0.56 0.237 267.796);
  --chart-3: oklch(0.666 0.28 319.327);
  --chart-4: oklch(0.588 0.219 268.954);
  --chart-5: oklch(0.551 0.267 288.685);
}

.dark {
  --radius: 0.5rem;
  --background: oklch(0.117 0.021 300.977);
  --foreground: oklch(0.991 0.002 300.733);
  --muted: oklch(0.161 0.012 275.088);
  --muted-foreground: oklch(0.762 0.004 276.104);
  --popover: oklch(0.117 0.021 300.977);
  --popover-foreground: oklch(0.991 0.002 300.733);
  --card: oklch(0.129 0.025 299.872);
  --card-foreground: oklch(1 0 180);
  --border: oklch(0.278 0.03 256.848);
  --input: oklch(0.278 0.03 256.848);
  --primary: oklch(0.552 0.261 289.227);
  --primary-foreground: oklch(1 0 180);
  --secondary: oklch(0.56 0.237 267.796);
  --secondary-foreground: oklch(1 0 180);
  --accent: oklch(0.666 0.28 319.327);
  --accent-foreground: oklch(0 0 0);
  --destructive: oklch(0.603 0.24 29.493);
  --destructive-foreground: oklch(1 0 180);
  --ring: oklch(0.552 0.261 289.227);
  --chart-1: oklch(0.552 0.261 289.227);
  --chart-2: oklch(0.56 0.237 267.796);
  --chart-3: oklch(0.666 0.28 319.327);
  --chart-4: oklch(0.588 0.219 268.954);
  --chart-5: oklch(0.551 0.267 288.685);
}