Add a reviewed `theme` plugin kind (interfaceVersion 1, export `theme`, switch
"list"). A module returns data only: a displayName and a flat map of colour
custom properties for light, dim and dark. checkTheme validates names and
#rrggbb colours strictly and checks each text/background pair for contrast; a
bad module is refused and logged, never served.
The ten shipped palettes become the first ten modules under
packages/plugins/theme/<name>/. Modules are found by directory scan
(loader.discoverModules, loader.loadInstalled), not by a list in the Console.
loadModule and createLoader are unchanged.
The organization file takes `appearance: { theme, mode }`, validated in
packages/business/src/appearance.mjs; a missing appearance is valid.
GET /api/themes (themes-http.mjs) serves the installed, valid themes.
Browser: the Settings picker lists /api/themes. Precedence is a per-organization
browser override, then the organization's saved theme, then the built-in default
(Harbor, dark). Clearing the override restores the organization's choice. An
uninstalled or invalid saved theme renders the default with a visible warning
and keeps the saved value. A legacy global browser preference is not copied to
every organization. The organization is named in text, so colour is never the
only cue. A plain load writes no appearance record. The default look is
unchanged: computed styles match the base commit element for element.
60 lines
1.7 KiB
JavaScript
60 lines
1.7 KiB
JavaScript
// Graphite: monochromatic. One blue-gray hue uses value and saturation changes instead of a second brand hue. Semantic status colors remain independent.
|
|
// Same values as docs/design/tokens.json; the theme test pins them to it.
|
|
export const interfaceVersion = 1;
|
|
|
|
export function theme() {
|
|
return {
|
|
displayName: "Graphite",
|
|
tokens: {
|
|
light: {
|
|
"--canvas": "#f5f5f5",
|
|
"--surface": "#ffffff",
|
|
"--raised": "#eaeaeb",
|
|
"--line": "#d5d6d7",
|
|
"--border": "#636e7e",
|
|
"--text": "#434d5b",
|
|
"--muted": "#5e6978",
|
|
"--action": "#616975",
|
|
"--onAction": "#ffffff",
|
|
"--accent": "#5e6978",
|
|
"--focus": "#616975",
|
|
"--success": "#287658",
|
|
"--warning": "#8f5c19",
|
|
"--danger": "#ba2e26",
|
|
},
|
|
dim: {
|
|
"--canvas": "#2d2e2f",
|
|
"--surface": "#393a3c",
|
|
"--raised": "#454749",
|
|
"--line": "#57595c",
|
|
"--border": "#a4abb7",
|
|
"--text": "#dfe2e7",
|
|
"--muted": "#afb6c0",
|
|
"--action": "#b1b6be",
|
|
"--onAction": "#10141a",
|
|
"--accent": "#afb6c0",
|
|
"--focus": "#b1b6be",
|
|
"--success": "#85d5b7",
|
|
"--warning": "#e7b574",
|
|
"--danger": "#eba29e",
|
|
},
|
|
dark: {
|
|
"--canvas": "#161718",
|
|
"--surface": "#232425",
|
|
"--raised": "#323334",
|
|
"--line": "#454749",
|
|
"--border": "#a4abb7",
|
|
"--text": "#bcc3cd",
|
|
"--muted": "#a4abb7",
|
|
"--action": "#a6acb5",
|
|
"--onAction": "#10141a",
|
|
"--accent": "#a4abb7",
|
|
"--focus": "#a6acb5",
|
|
"--success": "#85d5b7",
|
|
"--warning": "#e7b574",
|
|
"--danger": "#e37d78",
|
|
},
|
|
},
|
|
};
|
|
}
|