Skip to content

CSS Variables Reference ​

This page lists all CSS custom properties available in Editu. Color values use the OKLCH color space for perceptual uniformity and wider gamut support.

Overview ​

Editu provides CSS custom properties for theming. The following categories organize these variables:

CategoryDescription
ColorsPrimary, secondary, background, foreground, and state colors
TypographyFont families, sizes, weights, and line heights
Spacing & LayoutSpacing scale, border radius, shadows, and z-index
ComponentsEditor, image, code block, and math-specific variables
IntegrationsTailwind CSS and shadcn/ui integration guides

Why OKLCH? ​

Editu uses the OKLCH color space for all color values because:

  1. Perceptual uniformity — Colors with the same lightness value appear equally bright
  2. Predictable manipulation — Adjusting hue, chroma, or lightness produces predictable results
  3. Wider gamut — Provides access to colors beyond sRGB on supported displays
  4. Dark mode — Simplifies creating accessible color variations

OKLCH is supported in all modern browsers (Chrome 111+, Firefox 113+, Safari 15.4+).

Theme Selectors ​

These CSS selectors trigger theme changes:

css
/* Light theme (default) */
:root,
.light,
[data-theme="light"],
[data-editu-theme="light"] {
  /* Light theme variables */
}

/* Dark theme */
.dark,
[data-theme="dark"],
[data-editu-theme="dark"] {
  /* Dark theme variables */
}

Quick Example ​

css
/* Custom theme overrides using OKLCH */
:root {
  /* Custom primary color (purple) */
  --editu-primary: oklch(0.627 0.265 303.9);
  --editu-primary-hover: oklch(0.558 0.288 302.321);
  
  /* Custom border radius */
  --editu-radius-md: 8px;
  --editu-radius-lg: 12px;
  
  /* Custom editor settings */
  --editu-editor-min-height: 500px;
}

[data-editu-theme="dark"] {
  --editu-primary: oklch(0.714 0.203 305.504);
}

Next Steps ​

Released under the MIT License.