Rice for shadcn/ui

Rice is a shadcn/ui theme built around a vivid violet primary color (#b861ea) with muted light violet accents (#cec4d4). The light mode uses a neutral background (#faf8fc). Dark mode keeps the vivid violet primary (#b861ea) on a neutral background (#030104).

Color palette

TokenLightDark
Background
#faf8fcghostwhite
#030104black
Foreground
#0c0311black
#ffffffwhite
Card
#f8f5fawhitesmoke
#060307black
Card foreground
#09020dblack
#ffffffwhite
Popover
#faf8fcghostwhite
#030104black
Popover foreground
#0c0311black
#ffffffwhite
Primary
#b861eamediumorchid
#b861eamediumorchid
Primary foreground
#000000black
#000000black
Secondary
#e1dee3gainsboro
#18131bblack
Secondary foreground
#49424cdarkslategray
#b4a1bfdarkgray
Muted
#e4dee8gainsboro
#1d1721black
Muted foreground
#5c4f63dimgray
#a89cb0darkgray
Accent
#cec4d4thistle
#2c1f33darkslategray
Accent foreground
#352b3bdarkslategray
#c6b3d1silver
Destructive
#c54b16chocolate
#ea723etomato
Destructive foreground
#ffffffwhite
#000000black
Border
#e5e7eblavender
#1f2937darkslategray
Input
#e5e7eblavender
#1f2937darkslategray
Ring
#b861eamediumorchid
#b861eamediumorchid

Contrast

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

Light mode
Text on background19.22:1AAA
Text on card18.90:1AAA
Primary button5.94:1AA
Secondary button7.28:1AAA
Muted text5.78:1AA
Accent8.01:1AAA
Destructive4.78:1AA
Dark mode
Text on background20.76:1AAA
Text on card20.53:1AAA
Primary button5.94:1AA
Secondary button7.67:1AAA
Muted text6.70:1AA
Accent8.00:1AAA
Destructive6.94:1AA

CSS variables

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

:root {
  --radius: 0.5rem;
  --background: oklch(0.982 0.005 313.574);
  --foreground: oklch(0.128 0.038 313.925);
  --muted: oklch(0.909 0.014 313.508);
  --muted-foreground: oklch(0.449 0.035 313.125);
  --popover: oklch(0.982 0.005 313.574);
  --popover-foreground: oklch(0.128 0.038 313.925);
  --card: oklch(0.973 0.008 313.557);
  --card-foreground: oklch(0.116 0.033 315.492);
  --border: oklch(0.928 0.006 264.531);
  --input: oklch(0.928 0.006 264.531);
  --primary: oklch(0.652 0.208 311.178);
  --primary-foreground: oklch(0 0 0);
  --secondary: oklch(0.905 0.006 313.562);
  --secondary-foreground: oklch(0.391 0.019 313.314);
  --accent: oklch(0.834 0.024 313.432);
  --accent-foreground: oklch(0.308 0.03 313.005);
  --destructive: oklch(0.571 0.168 40.069);
  --destructive-foreground: oklch(1 0 180);
  --ring: oklch(0.652 0.208 311.178);
  --chart-1: oklch(0.652 0.208 311.178);
  --chart-2: oklch(0.905 0.006 313.562);
  --chart-3: oklch(0.834 0.024 313.432);
  --chart-4: oklch(0.929 0.005 313.574);
  --chart-5: oklch(0.651 0.215 311.044);
}

.dark {
  --radius: 0.5rem;
  --background: oklch(0.084 0.014 315.084);
  --foreground: oklch(1 0 180);
  --muted: oklch(0.217 0.02 313.028);
  --muted-foreground: oklch(0.709 0.031 313.334);
  --popover: oklch(0.084 0.014 315.084);
  --popover-foreground: oklch(1 0 180);
  --card: oklch(0.106 0.018 315.084);
  --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.652 0.208 311.178);
  --primary-foreground: oklch(0 0 0);
  --secondary: oklch(0.196 0.019 313.003);
  --secondary-foreground: oklch(0.735 0.048 313.209);
  --accent: oklch(0.263 0.041 312.615);
  --accent-foreground: oklch(0.791 0.048 313.237);
  --destructive: oklch(0.684 0.162 42.401);
  --destructive-foreground: oklch(0 0 0);
  --ring: oklch(0.652 0.208 311.178);
  --chart-1: oklch(0.652 0.208 311.178);
  --chart-2: oklch(0.196 0.019 313.003);
  --chart-3: oklch(0.263 0.041 312.615);
  --chart-4: oklch(0.227 0.025 312.936);
  --chart-5: oklch(0.651 0.215 311.044);
}