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.
When to use what
Section titled “When to use what”- Surface colours are backgrounds.
canvasis the page.raisedis a card or panel on it.sunkenis for inset areas such as wells.inputandmenuare for fields and menus.hoveris a translucent layer for hovered rows.lineis for borders and dividers.shellandtrayare gradient pairs (startandend) for the app frame. - Text colours are for words. Use
defaultfor body text and headings,mutedfor secondary text, andsubtlefor hints and metadata.faintandidleare for disabled text only; they do not meet contrast on purpose.on-shellis text on the shell. - Accent marks the brand:
defaultfor selected and active controls,textfor links and accent words. - Status colours carry
ok,warn,dangerandinfo. Each has a strong colour for icons and text and atintfor backgrounds. Status is never shown by colour alone: always add a word and an icon. - Focus colours draw the focus ring:
inneris the ink ring that carries the contrast,halois the gold ring around it. - Scrim dims the page behind a dialog.
Semantic colours
Section titled “Semantic colours”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.
| Token | Light | Dark |
|---|---|---|
| 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-start | rgb(18 18 18 / 0.035)1.07:1 | rgb(255 255 255 / 0.058)1.14:1 |
--rp-color-surface-tray-end | rgb(18 18 18 / 0.02)1.04:1 | rgb(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-hover | rgb(18 18 18 / 0.04)1.08:1 | rgb(255 255 255 / 0.06)1.15:1 |
--rp-color-surface-line | rgb(18 18 18 / 0.07)1.15:1 | rgb(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:1 | rgb(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:1 | rgb(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:1 | rgb(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:1 | rgb(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-scrim | rgb(0 0 0 / 0.55)4.68:1 | rgb(0 0 0 / 0.55)1.07:1 |
Primitives
Section titled “Primitives”The raw colours the roles are built from. They are the same in both themes. Use them only when you build a theme.
| Token | Light | Dark |
|---|---|---|
--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 |