Translation for shadcn/ui

Translation is a shadcn/ui theme built around a near-black primary color (#0b0a0a) with near-black accents (#0a0a0b). The light mode uses a neutral background (#fdfdfc). Dark mode keeps the near-black primary (#0b0a0a) on a neutral background (#000000).

Color palette

TokenLightDark
Background
#fdfdfcwhite
#000000black
Foreground
#000000black
#ffffffwhite
Card
#fbfbf8snow
#030303black
Card foreground
#000000black
#ffffffwhite
Popover
#fdfdfcwhite
#000000black
Popover foreground
#000000black
#ffffffwhite
Primary
#0b0a0ablack
#0b0a0ablack
Primary foreground
#a7a6a0darkgray
#a7a6a0darkgray
Secondary
#0a0a0bblack
#0a0a0bblack
Secondary foreground
#a0a1a7darkgray
#a0a1a7darkgray
Muted
#dadce7gainsboro
#181a25black
Muted foreground
#56596cdimgray
#9397a9darkgray
Accent
#0a0a0bblack
#0a0a0bblack
Accent foreground
#a0a1a7darkgray
#a0a1a7darkgray
Destructive
#91230dsaddlebrown
#ed593btomato
Destructive foreground
#fbdbd5mistyrose
#000000black
Border
#e5e7eblavender
#1f2937darkslategray
Input
#e5e7eblavender
#1f2937darkslategray
Ring
#0b0a0ablack
#0b0a0ablack

Contrast

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

Light mode
Text on background20.63:1AAA
Text on card20.27:1AAA
Primary button8.09:1AAA
Secondary button7.68:1AAA
Muted text5.05:1AA
Accent7.68:1AAA
Destructive6.61:1AA
Dark mode
Text on background21.00:1AAA
Text on card20.67:1AAA
Primary button8.09:1AAA
Secondary button7.68:1AAA
Muted text5.96:1AA
Accent7.68:1AAA
Destructive6.07:1AA

CSS variables

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

:root {
  --radius: 0.5rem;
  --background: oklch(0.994 0.002 98.343);
  --foreground: oklch(0 0 0);
  --muted: oklch(0.896 0.015 278.071);
  --muted-foreground: oklch(0.47 0.03 277.325);
  --popover: oklch(0.994 0.002 98.343);
  --popover-foreground: oklch(0 0 0);
  --card: oklch(0.988 0.004 98.369);
  --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.147 0.001 98.448);
  --primary-foreground: oklch(0.723 0.009 98.49);
  --secondary: oklch(0.145 0.001 278.064);
  --secondary-foreground: oklch(0.709 0.009 278.13);
  --accent: oklch(0.145 0.001 278.064);
  --accent-foreground: oklch(0.709 0.009 278.13);
  --destructive: oklch(0.434 0.148 32.915);
  --destructive-foreground: oklch(0.917 0.036 31.17);
  --ring: oklch(0.147 0.001 98.448);
  --chart-1: oklch(0.147 0.001 98.448);
  --chart-2: oklch(0.145 0.001 278.064);
  --chart-3: oklch(0.145 0.001 278.064);
  --chart-4: oklch(0.18 0.002 278.114);
  --chart-5: oklch(0.148 0.003 98.6);
}

.dark {
  --radius: 0.5rem;
  --background: oklch(0 0 0);
  --foreground: oklch(1 0 180);
  --muted: oklch(0.221 0.022 276.711);
  --muted-foreground: oklch(0.679 0.027 277.714);
  --popover: oklch(0 0 0);
  --popover-foreground: oklch(1 0 180);
  --card: oklch(0.092 0 180);
  --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.147 0.001 98.448);
  --primary-foreground: oklch(0.723 0.009 98.49);
  --secondary: oklch(0.145 0.001 278.064);
  --secondary-foreground: oklch(0.709 0.009 278.13);
  --accent: oklch(0.145 0.001 278.064);
  --accent-foreground: oklch(0.709 0.009 278.13);
  --destructive: oklch(0.654 0.189 33.196);
  --destructive-foreground: oklch(0 0 0);
  --ring: oklch(0.147 0.001 98.448);
  --chart-1: oklch(0.147 0.001 98.448);
  --chart-2: oklch(0.145 0.001 278.064);
  --chart-3: oklch(0.145 0.001 278.064);
  --chart-4: oklch(0.18 0.002 278.114);
  --chart-5: oklch(0.148 0.003 98.6);
}