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
// Atlantic: analogous. Ocean blue and teal sit close on the hue wheel. Their shared cool bias makes a quieter combination than an opposing accent.
|
|
// Same values as docs/design/tokens.json; the theme test pins them to it.
|
|
export const interfaceVersion = 1;
|
|
|
|
export function theme() {
|
|
return {
|
|
displayName: "Atlantic",
|
|
tokens: {
|
|
light: {
|
|
"--canvas": "#f3f6f7",
|
|
"--surface": "#ffffff",
|
|
"--raised": "#e6ecef",
|
|
"--line": "#cdd9df",
|
|
"--border": "#63757e",
|
|
"--text": "#3f4e55",
|
|
"--muted": "#5c6d75",
|
|
"--action": "#19719a",
|
|
"--onAction": "#ffffff",
|
|
"--accent": "#257467",
|
|
"--focus": "#19719a",
|
|
"--success": "#287658",
|
|
"--warning": "#935f1a",
|
|
"--danger": "#ba2e26",
|
|
},
|
|
dim: {
|
|
"--canvas": "#243238",
|
|
"--surface": "#2e3f47",
|
|
"--raised": "#384d57",
|
|
"--line": "#46606d",
|
|
"--border": "#a4b1b7",
|
|
"--text": "#e2e7e9",
|
|
"--muted": "#afbbc0",
|
|
"--action": "#73c3e8",
|
|
"--onAction": "#10141a",
|
|
"--accent": "#83d8ca",
|
|
"--focus": "#73c3e8",
|
|
"--success": "#85d5b7",
|
|
"--warning": "#e7b574",
|
|
"--danger": "#edaaa6",
|
|
},
|
|
dark: {
|
|
"--canvas": "#12191c",
|
|
"--surface": "#1c272b",
|
|
"--raised": "#28373e",
|
|
"--line": "#384d57",
|
|
"--border": "#a4b1b7",
|
|
"--text": "#bcc8cd",
|
|
"--muted": "#a4b1b7",
|
|
"--action": "#73c3e8",
|
|
"--onAction": "#10141a",
|
|
"--accent": "#83d8ca",
|
|
"--focus": "#73c3e8",
|
|
"--success": "#85d5b7",
|
|
"--warning": "#e7b574",
|
|
"--danger": "#e4817c",
|
|
},
|
|
},
|
|
};
|
|
}
|