CodeRunner 2 Theme for shadcn/ui

CodeRunner 2 Theme is a shadcn/ui theme built around a near-white primary color (#ffffff) with muted blue accents (#414a5d). The light mode uses a blue-tinted background (#212630). Dark mode keeps the near-white primary (#ffffff) on a blue-tinted background (#212630).

Color palette

TokenLightDark
Background
#212630darkslategray
#212630darkslategray
Foreground
#c0c5cesilver
#c0c5cesilver
Card
#1d222adarkslategray
#1d222adarkslategray
Card foreground
#ced2d9lightgrey
#ced2d9lightgrey
Popover
#1b1f27black
#1b1f27black
Popover foreground
#dcdfe4gainsboro
#dcdfe4gainsboro
Primary
#ffffffwhite
#ffffffwhite
Primary foreground
#333333darkslategray
#333333darkslategray
Secondary
#404040darkslategray
#404040darkslategray
Secondary foreground
#d9d9d9gainsboro
#d9d9d9gainsboro
Muted
#2d3139darkslategray
#2d3139darkslategray
Muted foreground
#a9afbcdarkgray
#a9afbcdarkgray
Accent
#414a5ddarkslategray
#414a5ddarkslategray
Accent foreground
#e4e7eclavender
#e4e7eclavender
Destructive
#e7230dorangered
#e7230dorangered
Destructive foreground
#ffffffwhite
#ffffffwhite
Border
#31343adarkslategray
#31343adarkslategray
Input
#383c42darkslategray
#383c42darkslategray
Ring
#ffffffwhite
#ffffffwhite

Contrast

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

Light mode
Text on background8.71:1AAA
Text on card10.56:1AAA
Primary button12.63:1AAA
Secondary button7.37:1AAA
Muted text5.93:1AA
Accent7.14:1AAA
Destructive4.50:1AA
Dark mode
Text on background8.71:1AAA
Text on card10.56:1AAA
Primary button12.63:1AAA
Secondary button7.37:1AAA
Muted text5.93:1AA
Accent7.14:1AAA
Destructive4.50:1AA

CSS variables

Paste this into your globals.css to use CodeRunner 2 Theme in your shadcn/ui project.

:root {
  --radius: 0.5rem;
  --background: oklch(0.27 0.02 264.168);
  --foreground: oklch(0.822 0.013 263.019);
  --muted: oklch(0.312 0.016 264.317);
  --muted-foreground: oklch(0.754 0.019 264.455);
  --popover: oklch(0.239 0.016 264.198);
  --popover-foreground: oklch(0.904 0.008 263.038);
  --card: oklch(0.25 0.017 264.187);
  --card-foreground: oklch(0.863 0.011 263.028);
  --border: oklch(0.325 0.011 264.413);
  --input: oklch(0.354 0.012 264.408);
  --primary: oklch(1 0 180);
  --primary-foreground: oklch(0.321 0 180);
  --secondary: oklch(0.371 0 168.69);
  --secondary-foreground: oklch(0.885 0 180);
  --accent: oklch(0.41 0.034 264.089);
  --accent-foreground: oklch(0.926 0.008 264.523);
  --destructive: oklch(0.595 0.228 30.446);
  --destructive-foreground: oklch(1 0 180);
  --ring: oklch(1 0 180);
  --chart-1: oklch(1 0 180);
  --chart-2: oklch(0.371 0 168.69);
  --chart-3: oklch(0.41 0.034 264.089);
  --chart-4: oklch(0.399 0 180);
  --chart-5: oklch(1 0 180);
}

.dark {
  --radius: 0.5rem;
  --background: oklch(0.27 0.02 264.168);
  --foreground: oklch(0.822 0.013 263.019);
  --muted: oklch(0.312 0.016 264.317);
  --muted-foreground: oklch(0.754 0.019 264.455);
  --popover: oklch(0.239 0.016 264.198);
  --popover-foreground: oklch(0.904 0.008 263.038);
  --card: oklch(0.25 0.017 264.187);
  --card-foreground: oklch(0.863 0.011 263.028);
  --border: oklch(0.325 0.011 264.413);
  --input: oklch(0.354 0.012 264.408);
  --primary: oklch(1 0 180);
  --primary-foreground: oklch(0.321 0 180);
  --secondary: oklch(0.371 0 168.69);
  --secondary-foreground: oklch(0.885 0 180);
  --accent: oklch(0.41 0.034 264.089);
  --accent-foreground: oklch(0.926 0.008 264.523);
  --destructive: oklch(0.595 0.228 30.446);
  --destructive-foreground: oklch(1 0 180);
  --ring: oklch(1 0 180);
  --chart-1: oklch(1 0 180);
  --chart-2: oklch(0.371 0 168.69);
  --chart-3: oklch(0.41 0.034 264.089);
  --chart-4: oklch(0.399 0 180);
  --chart-5: oklch(1 0 180);
}