Install steps, page guides and appearance settings now summarise and link the documentation site. The pages keep what belongs to the repository: package layout, how themes, fonts and flags are built and added, sources and licences. Wrong statements about the region cache size, the fonts README request and tab names are corrected.
3.5 KiB
Themes and palettes
The standard edition defines 15 palettes, each pairing light and dark colors. For choosing a palette, wallpaper or transparency setting, see appearance settings.
See the theme gallery for every palette in light and dark.
Source map
| Source | Responsibility |
|---|---|
| src/shell/palettes.ts | Palette IDs, menu order, label keys, optional wording overrides and the default rose-pine/moon |
| src/shell/preferences.ts | Stored palette validation and system, light or dark color scheme |
| src/shell/useAppearance.ts | Apply data-family, data-flavour and data-scheme to the document root |
| src/ui/styles/palettes/ | One CSS file per palette family, with light and dark tokens |
| src/ui/styles/palettes.css | Imports for non-Glass palette families |
| src/shell/glass.ts | Load Glass styles and wallpaper when needed |
| src/ui/charts/palette.ts | Read CSS tokens for charts and observe palette changes |
Palette contract
A palette ID has the form family/flavour. A single-flavour family repeats the name, as in nord/nord. CSS selectors use those two values and data-scheme to select tokens. Components consume the shared --rp-* tokens.
Each palette supplies surface, text, accent, chart, highlight and shadow tokens. The complete token table and contrast rules are in Add a palette. tools/palettes.test.mjs checks family files, imports and required tokens.
Glass tokens load through src/ui/styles/glass.css, alongside the material styles. Preserve this separate loading path when changing a Glass palette.
In the Qiangguo palette, a running state reads Improving; unavailable and degraded states read Severe test. These wording overrides are defined in src/shell/palettes.ts and the locale catalogues.
Add or update a palette
- Update
src/shell/palettes.tsand the family stylesheet. Import a new non-Glass family fromsrc/ui/styles/palettes.css. - Add label keys to src/i18n/locales/. An optional
wordsmap in the registry redirects existing translation keys to palette-specific ones. - Keep family images beside the stylesheet under
src/ui/styles/palettes/<family>/. Record their sources and licences in NOTICE and REUSE.toml. - Update the palette map in e2e/contrast.spec.ts. Run the palette and contrast checks required by CONTRIBUTING.md, and inspect both schemes. The contrast spec excludes translucent Glass surfaces from its numeric checks.