Establish Mission Core as the shared theme foundation
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user