Ternux
Advanced

Themes

How the Ternux theme system works and how to extend it.

Ternux uses CSS custom properties (variables) defined in styles.css to implement its theme system. This ensures all colors are consistent and override-friendly.

Theme attributes

Two HTML attributes drive the theme:

AttributeValuesControls
data-themedark | lightBase background, text, and surface colors
data-color-schemedefault | one-dark-proAccent color, syntax colors, chrome tints

Both are set on <html> and update live without a page reload.

CSS variables

Key variables (defined in src/styles.css):

VariablePurpose
--color-bgMain window background
--color-cardCard and panel surfaces
--color-textPrimary text
--color-text-mutedSecondary / dimmed text
--color-accentTeal accent (buttons, active states, selection rings)
--color-borderDividers and borders
--color-sidebarLeft sidebar background

Terminal theme

The terminal reads its own set of variables via resolveTerminalTheme() in LocalTerminal.tsx. The terminal foreground, background, cursor, and ANSI palette colors update live when you switch themes.

Available color schemes

Default

Teal accent, neutral dark/light surfaces. Clean and professional.

One Dark Pro

Inspired by the popular VS Code theme. Warmer background tones with a blueish accent.

Adding a custom color scheme

  1. Add a new [data-color-scheme="your-scheme"] override block in src/styles.css.
  2. Override the CSS variables you want to change.
  3. Add the scheme option to appearanceSettings in the config types and settings UI.

All component styles must use CSS variable references, never hardcoded color values. This rule applies to both Tailwind utilities and inline styles.

On this page