Fraction for shadcn/ui

Fraction is a shadcn/ui theme built around a neutral gray primary color (#d1d2d7) with neutral gray accents (#d2d1d7). The light mode uses a neutral background (#fbfcfe). Dark mode keeps the neutral gray primary (#d1d2d7) on a blue-tinted background (#04050b).

Color palette

TokenLightDark
Background
#fbfcfewhite
#04050bblack
Foreground
#010309black
#f9f9fbghostwhite
Card
#f7f8fdghostwhite
#05070fblack
Card foreground
#010105black
#fcfcfdwhite
Popover
#fbfcfewhite
#04050bblack
Popover foreground
#010309black
#f9f9fbghostwhite
Primary
#d1d2d7lightgrey
#d1d2d7lightgrey
Primary foreground
#37383fdarkslategray
#37383fdarkslategray
Secondary
#d1d5d7lightgrey
#d1d5d7lightgrey
Secondary foreground
#373c3fdarkslategray
#373c3fdarkslategray
Muted
#dde2e4gainsboro
#1b2022black
Muted foreground
#525c60dimgray
#9fa9addarkgray
Accent
#d2d1d7lightgrey
#d2d1d7lightgrey
Accent foreground
#39373fdarkslategray
#39373fdarkslategray
Destructive
#771803maroon
#f9471forangered
Destructive foreground
#fdbeaflightpink
#ffffffwhite
Border
#e5e7eblavender
#1f2937darkslategray
Input
#e5e7eblavender
#1f2937darkslategray
Ring
#d1d2d7lightgrey
#d1d2d7lightgrey

Contrast

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

Light mode
Text on background20.04:1AAA
Text on card19.68:1AAA
Primary button7.71:1AAA
Secondary button7.54:1AAA
Muted text5.24:1AA
Accent7.70:1AAA
Destructive6.83:1AA
Dark mode
Text on background19.32:1AAA
Text on card19.60:1AAA
Primary button7.71:1AAA
Secondary button7.54:1AAA
Muted text6.85:1AA
Accent7.70:1AAA
Destructive3.52:1AA Large

CSS variables

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

:root {
  --radius: 0.5rem;
  --background: oklch(0.99 0.003 274.999);
  --foreground: oklch(0.095 0.024 263.372);
  --muted: oklch(0.909 0.006 225.06);
  --muted-foreground: oklch(0.468 0.014 225.368);
  --popover: oklch(0.99 0.003 274.999);
  --popover-foreground: oklch(0.095 0.024 263.372);
  --card: oklch(0.98 0.006 274.963);
  --card-foreground: oklch(0.076 0.019 263.372);
  --border: oklch(0.928 0.006 264.531);
  --input: oklch(0.928 0.006 264.531);
  --primary: oklch(0.864 0.007 274.938);
  --primary-foreground: oklch(0.342 0.012 274.593);
  --secondary: oklch(0.87 0.005 225.05);
  --secondary-foreground: oklch(0.353 0.009 225.29);
  --accent: oklch(0.863 0.009 299.872);
  --accent-foreground: oklch(0.341 0.015 299.318);
  --destructive: oklch(0.374 0.133 33.539);
  --destructive-foreground: oklch(0.854 0.076 32.962);
  --ring: oklch(0.864 0.007 274.938);
  --chart-1: oklch(0.864 0.007 274.938);
  --chart-2: oklch(0.87 0.005 225.05);
  --chart-3: oklch(0.863 0.009 299.872);
  --chart-4: oklch(0.893 0.004 225.036);
  --chart-5: oklch(0.862 0.01 274.895);
}

.dark {
  --radius: 0.5rem;
  --background: oklch(0.119 0.017 269.111);
  --foreground: oklch(0.983 0.003 275);
  --muted: oklch(0.24 0.009 225.452);
  --muted-foreground: oklch(0.727 0.013 225.192);
  --popover: oklch(0.119 0.017 269.111);
  --popover-foreground: oklch(0.983 0.003 275);
  --card: oklch(0.131 0.019 269.874);
  --card-foreground: oklch(0.991 0.001 275.017);
  --border: oklch(0.278 0.03 256.848);
  --input: oklch(0.278 0.03 256.848);
  --primary: oklch(0.864 0.007 274.938);
  --primary-foreground: oklch(0.342 0.012 274.593);
  --secondary: oklch(0.87 0.005 225.05);
  --secondary-foreground: oklch(0.353 0.009 225.29);
  --accent: oklch(0.863 0.009 299.872);
  --accent-foreground: oklch(0.341 0.015 299.318);
  --destructive: oklch(0.654 0.22 33.624);
  --destructive-foreground: oklch(1 0 180);
  --ring: oklch(0.864 0.007 274.938);
  --chart-1: oklch(0.864 0.007 274.938);
  --chart-2: oklch(0.87 0.005 225.05);
  --chart-3: oklch(0.863 0.009 299.872);
  --chart-4: oklch(0.893 0.004 225.036);
  --chart-5: oklch(0.862 0.01 274.895);
}