Flag for shadcn/ui

Flag is a shadcn/ui theme built around a deep green primary color (#0a4222) with neutral gray accents (#dfe2e0). The light mode uses a neutral background (#f7fcf9). Dark mode keeps the deep green primary (#0a4222) on a neutral background (#020805).

Color palette

TokenLightDark
Background
#f7fcf9mintcream
#020805black
Foreground
#06140cblack
#ffffffwhite
Card
#f7fcf9mintcream
#020805black
Card foreground
#06140cblack
#ffffffwhite
Popover
#f7fcf9mintcream
#020805black
Popover foreground
#06140cblack
#ffffffwhite
Primary
#0a4222darkgreen
#0a4222darkgreen
Primary foreground
#38e07emediumseagreen
#38e07emediumseagreen
Secondary
#dfe2e0gainsboro
#222a26darkslategray
Secondary foreground
#434c47darkslategray
#b9c6besilver
Muted
#ebefedwhitesmoke
#101411black
Muted foreground
#606261dimgray
#9d9f9edarkgray
Accent
#dfe2e0gainsboro
#222a26darkslategray
Accent foreground
#434c47darkslategray
#b9c6besilver
Destructive
#8e210bdarkred
#f15f41tomato
Destructive foreground
#fbd7d0bisque
#000000black
Border
#e5e7eblavender
#1f2937darkslategray
Input
#e5e7eblavender
#1f2937darkslategray
Ring
#0a4222darkgreen
#0a4222darkgreen

Contrast

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

Light mode
Text on background18.25:1AAA
Text on card18.25:1AAA
Primary button6.66:1AA
Secondary button6.81:1AA
Muted text5.31:1AA
Accent6.81:1AA
Destructive6.62:1AA
Dark mode
Text on background20.20:1AAA
Text on card20.20:1AAA
Primary button6.66:1AA
Secondary button8.31:1AAA
Muted text6.97:1AA
Accent8.31:1AAA
Destructive6.42:1AA

CSS variables

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

:root {
  --radius: 0.5rem;
  --background: oklch(0.988 0.007 160.858);
  --foreground: oklch(0.173 0.026 157.688);
  --muted: oklch(0.949 0.006 160.861);
  --muted-foreground: oklch(0.494 0.003 160.87);
  --popover: oklch(0.988 0.007 160.858);
  --popover-foreground: oklch(0.173 0.026 157.688);
  --card: oklch(0.988 0.007 160.858);
  --card-foreground: oklch(0.173 0.026 157.688);
  --border: oklch(0.928 0.006 264.531);
  --input: oklch(0.928 0.006 264.531);
  --primary: oklch(0.336 0.08 152.524);
  --primary-foreground: oklch(0.801 0.192 152.4);
  --secondary: oklch(0.91 0.005 160.887);
  --secondary-foreground: oklch(0.406 0.014 160.188);
  --accent: oklch(0.91 0.005 160.887);
  --accent-foreground: oklch(0.406 0.014 160.188);
  --destructive: oklch(0.427 0.148 32.806);
  --destructive-foreground: oklch(0.908 0.042 31.205);
  --ring: oklch(0.336 0.08 152.524);
  --chart-1: oklch(0.336 0.08 152.524);
  --chart-2: oklch(0.91 0.005 160.887);
  --chart-3: oklch(0.91 0.005 160.887);
  --chart-4: oklch(0.933 0.004 160.921);
  --chart-5: oklch(0.339 0.082 152.219);
}

.dark {
  --radius: 0.5rem;
  --background: oklch(0.123 0.017 160.946);
  --foreground: oklch(1 0 180);
  --muted: oklch(0.186 0.009 159.815);
  --muted-foreground: oklch(0.701 0.003 160.92);
  --popover: oklch(0.123 0.017 160.946);
  --popover-foreground: oklch(1 0 180);
  --card: oklch(0.123 0.017 160.946);
  --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.336 0.08 152.524);
  --primary-foreground: oklch(0.801 0.192 152.4);
  --secondary: oklch(0.276 0.014 159.809);
  --secondary-foreground: oklch(0.813 0.017 160.503);
  --accent: oklch(0.276 0.014 159.809);
  --accent-foreground: oklch(0.813 0.017 160.503);
  --destructive: oklch(0.668 0.186 33.162);
  --destructive-foreground: oklch(0 0 0);
  --ring: oklch(0.336 0.08 152.524);
  --chart-1: oklch(0.336 0.08 152.524);
  --chart-2: oklch(0.276 0.014 159.809);
  --chart-3: oklch(0.276 0.014 159.809);
  --chart-4: oklch(0.309 0.016 159.752);
  --chart-5: oklch(0.339 0.082 152.219);
}