Skip to content

Colour

Colour in Republic is named by role, not by hue. Use this page to pick the right role for a surface, a piece of text or a status. Every role has a light and a dark value, and the page theme picks between them.

Always use a semantic token such as --rp-color-text-muted. Never use a primitive such as --rp-color-green-600 in a product. Primitives are the raw ramp the roles are built from. A theme changes the roles, so code that uses roles follows the theme and code that uses primitives does not.

  • Surface colours are backgrounds. canvas is the page. raised is a card or panel on it. sunken is for inset areas such as wells. input and menu are for fields and menus. hover is a translucent layer for hovered rows. line is for borders and dividers. shell and tray are gradient pairs (start and end) for the app frame.
  • Text colours are for words. Use default for body text and headings, muted for secondary text, and subtle for hints and metadata. faint and idle are for disabled text only; they do not meet contrast on purpose. on-shell is text on the shell.
  • Accent marks the brand: default for selected and active controls, text for links and accent words.
  • Status colours carry ok, warn, danger and info. Each has a strong colour for icons and text and a tint for backgrounds. Status is never shown by colour alone: always add a word and an icon.
  • Focus colours draw the focus ring: inner is the ink ring that carries the contrast, halo is the gold ring around it.
  • Scrim dims the page behind a dialog.

Each value is shown with its contrast against the canvas of the same theme. Text colours need 4.5:1. Control boundaries and the inner focus ring need 3:1. Surfaces sit close to the canvas on purpose, so their figure is low. Translucent colours are measured after they are laid over the canvas.

Semantic colours, with contrast against the canvas of each theme
TokenLightDark
Surface
--rp-color-surface-shell-start#0F4D3A9.20:1#0C33261.34:1
--rp-color-surface-shell-end#0B3D2E11.46:1#06201A1.09:1
--rp-color-surface-canvas#F7F8F71.00:1#1113121.00:1
--rp-color-surface-tray-startrgb(18 18 18 / 0.035)1.07:1rgb(255 255 255 / 0.058)1.14:1
--rp-color-surface-tray-endrgb(18 18 18 / 0.02)1.04:1rgb(255 255 255 / 0.03)1.06:1
--rp-color-surface-sunken#FFFFFF1.06:1#1618171.04:1
--rp-color-surface-raised#FFFFFF1.06:1#1D201F1.13:1
--rp-color-surface-hoverrgb(18 18 18 / 0.04)1.08:1rgb(255 255 255 / 0.06)1.15:1
--rp-color-surface-linergb(18 18 18 / 0.07)1.15:1rgb(255 255 255 / 0.07)1.18:1
--rp-color-surface-input#FFFFFF1.06:1#0C0E0D1.03:1
--rp-color-surface-menu#FFFFFF1.06:1#1A1D1C1.09:1
Text
--rp-color-text-default#12121217.59:1#EDEDED15.93:1
--rp-color-text-muted#4A4F4C7.84:1#B3B8B59.27:1
--rp-color-text-subtle#5E66625.55:1#8F95926.11:1
--rp-color-text-faint#A3ABA72.20:1#5C625F2.99:1
--rp-color-text-idle#DDE2DF1.23:1#3A3F3C1.73:1
--rp-color-text-on-shell#FFFFFF1.06:1#EDF5F116.81:1
Accent
--rp-color-accent-default#0B3D2E11.46:1#3FB57E7.21:1
--rp-color-accent-text#17634B6.74:1#5DD39A9.99:1
Status
--rp-color-status-ok#1E7A4F4.99:1#3FB57E7.21:1
--rp-color-status-ok-tint#E4F2EA1.08:1rgb(63 181 126 / 0.14)1.23:1
--rp-color-status-warn#9A4A005.88:1#FFB65C10.74:1
--rp-color-status-warn-tint#FFF1DE1.04:1rgb(255 182 92 / 0.14)1.31:1
--rp-color-status-danger#C8102E5.52:1#FF8A988.29:1
--rp-color-status-danger-tint#FCE8EB1.10:1rgb(255 138 152 / 0.14)1.25:1
--rp-color-status-info#1D5FA86.06:1#86B6F28.87:1
--rp-color-status-info-tint#E8F0FA1.07:1rgb(134 182 242 / 0.14)1.27:1
Focus
--rp-color-focus-inner#12121217.59:1#EDEDED15.93:1
--rp-color-focus-halo#FFCE001.40:1#FFCE0012.50:1
Scrim
--rp-color-scrimrgb(0 0 0 / 0.55)4.68:1rgb(0 0 0 / 0.55)1.07:1

The raw colours the roles are built from. They are the same in both themes. Use them only when you build a theme.

Primitive colours, with contrast against the canvas of each theme
TokenLightDark
--rp-color-green-100#E3EFE91.10:1#E3EFE915.80:1
--rp-color-green-200#A8E3C41.36:1#A8E3C412.83:1
--rp-color-green-300#5DD39A1.75:1#5DD39A9.99:1
--rp-color-green-400#3FB57E2.42:1#3FB57E7.21:1
--rp-color-green-500#1E7A4F4.99:1#1E7A4F3.51:1
--rp-color-green-600#17634B6.74:1#17634B2.59:1
--rp-color-green-700#0F4D3A9.20:1#0F4D3A1.90:1
--rp-color-green-800#0B3D2E11.46:1#0B3D2E1.52:1
--rp-color-green-900#072A2014.49:1#072A201.20:1
--rp-color-green-950#06201A16.04:1#06201A1.09:1
--rp-color-gold#FFCE001.40:1#FFCE0012.50:1
--rp-color-ink#12121217.59:1#1212121.00:1
--rp-color-white#FFFFFF1.06:1#FFFFFF18.65:1