Establish Mission Core as the shared theme foundation

This commit is contained in:
DCCONSTRUCTIONS
2026-11-05 13:46:35 +03:00
parent 06cb8ad4cd
commit 3750a94200
17 changed files with 240 additions and 107 deletions
+11 -2
View File
@@ -15,7 +15,7 @@ export interface NodedcMaterial {
export interface ApplyThemeOptions {
theme?: NodedcTheme;
/** Operator UI qualified against Mission Core; opt-in across portals. */
/** Mission Core is the canonical foundation. `default` is legacy compatibility. */
appearance?: "default" | "mission";
/** Flat surfaces remove decorative edges; keyboard focus uses a contrasting fill. */
edges?: "default" | "flat";
@@ -23,6 +23,15 @@ export interface ApplyThemeOptions {
material?: NodedcMaterial;
}
/** Complete shared foundation; colors live exclusively in @nodedc/tokens/themes.css. */
export const missionDarkTheme = Object.freeze({
theme: "dark", appearance: "mission", edges: "flat",
} as const satisfies ApplyThemeOptions);
export const missionLightTheme = Object.freeze({
theme: "light", appearance: "mission", edges: "flat",
} as const satisfies ApplyThemeOptions);
function formatRgb([red, green, blue]: RgbTuple): string {
return `${red} ${green} ${blue}`;
}
@@ -33,7 +42,7 @@ function clampOpacity(value: number): number {
export function applyNodedcTheme(
target: HTMLElement,
{ theme = "dark", accent, material, appearance = "default", edges = "default" }: ApplyThemeOptions = {},
{ theme = "dark", accent, material, appearance = "mission", edges = "flat" }: ApplyThemeOptions = {},
): void {
target.dataset.nodedcTheme = theme;
target.dataset.nodedcAppearance = appearance;
+5 -20
View File
@@ -422,7 +422,7 @@
}
.nodedc-field__control:hover:not(:disabled) {
background: var(--nodedc-glass-control-hover);
background: var(--nodedc-field-hover-bg);
}
.nodedc-field__control:focus-visible {
@@ -647,7 +647,7 @@ textarea.nodedc-field__control {
min-width: 0;
gap: 1rem;
border-radius: var(--nodedc-radius-card);
background: var(--nodedc-glass-control-bg);
background: var(--nodedc-surface-group);
padding: 1rem;
}
@@ -4380,26 +4380,11 @@ textarea.nodedc-field__control {
.nodedc-key-button:disabled { opacity:.4; cursor:not-allowed; }
.nodedc-key-button:focus-visible { outline:2px solid rgb(var(--nodedc-accent-rgb)); outline-offset:3px; }
/* Shared operator appearance, qualified against Mission Core 2026-09-30.
/* Canonical operator appearance, audited against Mission Core 2026-11-05.
Set on documentElement so modal and dropdown portals share the same profile. */
[data-nodedc-appearance="mission"][data-nodedc-theme="dark"] {
--nodedc-modal-surface: rgb(15 15 17 / .97);
--nodedc-floating-surface: rgb(15 15 17 / .98);
--nodedc-primary-action-bg: rgb(247 248 244 / .96);
--nodedc-primary-action-hover: rgb(255 255 255);
--nodedc-primary-action-color: rgb(8 8 10 / .96);
--nodedc-primary-action-shadow: none;
--nodedc-focus-surface: rgb(255 255 255 / .09);
}
[data-nodedc-appearance="mission"] .nodedc-glass-material::before { display: none; }
[data-nodedc-appearance="mission"][data-nodedc-theme="light"] {
--nodedc-modal-surface: rgb(247 248 250 / .97);
--nodedc-floating-surface: rgb(247 248 250 / .98);
--nodedc-primary-action-bg: rgb(24 25 28 / .96);
--nodedc-primary-action-hover: rgb(8 8 10);
--nodedc-primary-action-color: rgb(247 248 244);
--nodedc-primary-action-shadow: none;
}
[data-nodedc-appearance="mission"] .nodedc-header__avatar { background: rgb(226 226 226); }
[data-nodedc-appearance="mission"][data-nodedc-theme="dark"] .nodedc-feature-settings__section[data-active="true"] { background: rgb(247 248 244 / .14); }
[data-nodedc-appearance="mission"][data-nodedc-theme="light"] .nodedc-feature-settings__section[data-active="true"] { background: rgb(8 8 10 / .09); }