Similar for shadcn/ui

Similar is a shadcn/ui theme built around a light violet primary color (#c6a9e5) with light purple accents (#e4a9e5). The light mode uses a neutral background (#fcfbfe). Dark mode keeps the light violet primary (#c6a9e5) on a violet-tinted background (#0a070e).

Color palette

TokenLightDark
Background
#fcfbfewhite
#0a070eblack
Foreground
#030104black
#f7f5f9whitesmoke
Card
#fcfbfewhite
#0a070eblack
Card foreground
#030104black
#f7f5f9whitesmoke
Popover
#fcfbfewhite
#0a070eblack
Popover foreground
#030104black
#f7f5f9whitesmoke
Primary
#c6a9e5plum
#c6a9e5plum
Primary foreground
#2d1547midnightblue
#2d1547midnightblue
Secondary
#a9aae5lightsteelblue
#a9aae5lightsteelblue
Secondary foreground
#151647midnightblue
#151647midnightblue
Muted
#d7d8dfgainsboro
#202028black
Muted foreground
#373749darkslategray
#b6b7c8silver
Accent
#e4a9e5plum
#e4a9e5plum
Accent foreground
#461547midnightblue
#461547midnightblue
Destructive
#6b0c06maroon
#da190bred
Destructive foreground
#faada8lightpink
#ffffffwhite
Border
#e5e7eblavender
#1f2937darkslategray
Input
#e5e7eblavender
#1f2937darkslategray
Ring
#c6a9e5plum
#c6a9e5plum

Contrast

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

Light mode
Text on background20.15:1AAA
Text on card20.15:1AAA
Primary button7.77:1AAA
Secondary button7.70:1AAA
Muted text8.16:1AAA
Accent7.59:1AAA
Destructive6.92:1AA
Dark mode
Text on background18.48:1AAA
Text on card18.48:1AAA
Primary button7.77:1AAA
Secondary button7.70:1AAA
Muted text8.17:1AAA
Accent7.59:1AAA
Destructive5.08:1AA

CSS variables

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

:root {
  --radius: 0.5rem;
  --background: oklch(0.99 0.005 307.733);
  --foreground: oklch(0.081 0.018 309.335);
  --muted: oklch(0.883 0.011 285.402);
  --muted-foreground: oklch(0.344 0.031 283.915);
  --popover: oklch(0.99 0.005 307.733);
  --popover-foreground: oklch(0.081 0.018 309.335);
  --card: oklch(0.99 0.005 307.733);
  --card-foreground: oklch(0.081 0.018 309.335);
  --border: oklch(0.928 0.006 264.531);
  --input: oklch(0.928 0.006 264.531);
  --primary: oklch(0.78 0.09 306.43);
  --primary-foreground: oklch(0.26 0.09 302.87);
  --secondary: oklch(0.758 0.085 283.417);
  --secondary-foreground: oklch(0.235 0.089 276.358);
  --accent: oklch(0.808 0.106 325.953);
  --accent-foreground: oklch(0.297 0.101 327.084);
  --destructive: oklch(0.339 0.128 29.809);
  --destructive-foreground: oklch(0.821 0.092 23.792);
  --ring: oklch(0.78 0.09 306.43);
  --chart-1: oklch(0.78 0.09 306.43);
  --chart-2: oklch(0.758 0.085 283.417);
  --chart-3: oklch(0.808 0.106 325.953);
  --chart-4: oklch(0.791 0.073 283.848);
  --chart-5: oklch(0.777 0.095 306.347);
}

.dark {
  --radius: 0.5rem;
  --background: oklch(0.136 0.017 307.536);
  --foreground: oklch(0.974 0.006 307.721);
  --muted: oklch(0.246 0.015 284.509);
  --muted-foreground: oklch(0.783 0.025 285.039);
  --popover: oklch(0.136 0.017 307.536);
  --popover-foreground: oklch(0.974 0.006 307.721);
  --card: oklch(0.136 0.017 307.536);
  --card-foreground: oklch(0.974 0.006 307.721);
  --border: oklch(0.278 0.03 256.848);
  --input: oklch(0.278 0.03 256.848);
  --primary: oklch(0.78 0.09 306.43);
  --primary-foreground: oklch(0.26 0.09 302.87);
  --secondary: oklch(0.758 0.085 283.417);
  --secondary-foreground: oklch(0.235 0.089 276.358);
  --accent: oklch(0.808 0.106 325.953);
  --accent-foreground: oklch(0.297 0.101 327.084);
  --destructive: oklch(0.565 0.222 29.756);
  --destructive-foreground: oklch(1 0 180);
  --ring: oklch(0.78 0.09 306.43);
  --chart-1: oklch(0.78 0.09 306.43);
  --chart-2: oklch(0.758 0.085 283.417);
  --chart-3: oklch(0.808 0.106 325.953);
  --chart-4: oklch(0.791 0.073 283.848);
  --chart-5: oklch(0.777 0.095 306.347);
}