diff --git a/config/scripts/skills/bundle-generation/generate-plugin-authoring-skill-references.mjs b/config/scripts/skills/bundle-generation/generate-plugin-authoring-skill-references.mjs index 8f5a05f3495..3cffb8a6b53 100644 --- a/config/scripts/skills/bundle-generation/generate-plugin-authoring-skill-references.mjs +++ b/config/scripts/skills/bundle-generation/generate-plugin-authoring-skill-references.mjs @@ -258,7 +258,7 @@ function renderHostApi(sources, { frame, worker }) { [ '## Theme variables in frames', '', - "HTML panels and custom editors get these CSS variables from Orca's active theme, plus a `light` or `dark` class on ``. A theme change updates them in place and emits `theme` (`orca.on('theme', ...)`); the frame is not reloaded. Style from them, not fixed colours.", + "HTML panels and custom editors get these CSS variables from Orca's active theme and fonts, plus a `light` or `dark` class on ``. A theme or font change updates them in place and emits `theme` (`orca.on('theme', ...)`); the frame is not reloaded. Style from them, not fixed colours.", '', ...sources.themeTokens.pluginFrameThemeVariables().map(({ variable, paints }) => { // Name the frame's own variables, not the app theme tokens behind them. diff --git a/docs/reference/plugin-theme-tokens.md b/docs/reference/plugin-theme-tokens.md index 0218b7b7f7a..16cc9f2f950 100644 --- a/docs/reference/plugin-theme-tokens.md +++ b/docs/reference/plugin-theme-tokens.md @@ -83,7 +83,7 @@ Every key an app theme may set in `tokens` (see [plugin themes](plugin-themes.md ## Frame CSS variables -Panel and custom editor frames get these stable variables, set from Orca's active theme and updated in place when it changes. Other tokens are not exposed to frames. +Panel and custom editor frames get these stable variables, set from Orca's active theme and fonts and updated in place when they change. Other tokens are not exposed to frames. | Variable | Orca token | | --- | --- | @@ -107,3 +107,5 @@ Panel and custom editor frames get these stable variables, set from Orca's activ | `--orca-input` | `--input` | | `--orca-ring` | `--ring` | | `--orca-radius` | `--radius` | +| `--orca-font-sans` | `--font-sans` | +| `--orca-font-mono` | `--font-mono` | diff --git a/skill-guides/orca-plugin-authoring/references/host-api.md b/skill-guides/orca-plugin-authoring/references/host-api.md index 58424fbd792..5f4aee54cf7 100644 --- a/skill-guides/orca-plugin-authoring/references/host-api.md +++ b/skill-guides/orca-plugin-authoring/references/host-api.md @@ -44,7 +44,7 @@ Host API 1.10 (`"pluginApi": 1`). Call `host.call(method, params, { signal })`; ## Theme variables in frames -HTML panels and custom editors get these CSS variables from Orca's active theme, plus a `light` or `dark` class on ``. A theme change updates them in place and emits `theme` (`orca.on('theme', ...)`); the frame is not reloaded. Style from them, not fixed colours. +HTML panels and custom editors get these CSS variables from Orca's active theme and fonts, plus a `light` or `dark` class on ``. A theme or font change updates them in place and emits `theme` (`orca.on('theme', ...)`); the frame is not reloaded. Style from them, not fixed colours. - `--orca-background`: App canvas - `--orca-foreground`: Body text @@ -66,6 +66,8 @@ HTML panels and custom editors get these CSS variables from Orca's active theme, - `--orca-input`: Input borders - `--orca-ring`: Focus rings - `--orca-radius`: Corner radius of cards and controls +- `--orca-font-sans`: Interface font stack. Fonts Orca loads itself (the default Geist, plugin fonts) are not in frames, so the next installed font in the stack is used +- `--orca-font-mono`: Monospace font stack for code ## Methods diff --git a/src/cli/skills/bundled-skill-guides.ts b/src/cli/skills/bundled-skill-guides.ts index 32908329ed0..e4ce52afa02 100644 --- a/src/cli/skills/bundled-skill-guides.ts +++ b/src/cli/skills/bundled-skill-guides.ts @@ -3114,7 +3114,7 @@ const ORCA_PLUGIN_AUTHORING_HOST_API_REFERENCE_MARKDOWN = [ "", "## Theme variables in frames", "", - "HTML panels and custom editors get these CSS variables from Orca's active theme, plus a `light` or `dark` class on ``. A theme change updates them in place and emits `theme` (`orca.on('theme', ...)`); the frame is not reloaded. Style from them, not fixed colours.", + "HTML panels and custom editors get these CSS variables from Orca's active theme and fonts, plus a `light` or `dark` class on ``. A theme or font change updates them in place and emits `theme` (`orca.on('theme', ...)`); the frame is not reloaded. Style from them, not fixed colours.", "", "- `--orca-background`: App canvas", "- `--orca-foreground`: Body text", @@ -3136,6 +3136,8 @@ const ORCA_PLUGIN_AUTHORING_HOST_API_REFERENCE_MARKDOWN = [ "- `--orca-input`: Input borders", "- `--orca-ring`: Focus rings", "- `--orca-radius`: Corner radius of cards and controls", + "- `--orca-font-sans`: Interface font stack. Fonts Orca loads itself (the default Geist, plugin fonts) are not in frames, so the next installed font in the stack is used", + "- `--orca-font-mono`: Monospace font stack for code", "", "## Methods", "", diff --git a/src/shared/native-chat/visuals/native-chat-visual-shell.ts b/src/shared/native-chat/visuals/native-chat-visual-shell.ts index f069c801385..54dc6f56c33 100644 --- a/src/shared/native-chat/visuals/native-chat-visual-shell.ts +++ b/src/shared/native-chat/visuals/native-chat-visual-shell.ts @@ -63,9 +63,7 @@ export const NATIVE_CHAT_VISUAL_THEME_TOKENS = [ '--chart-2', '--chart-3', '--chart-4', - '--chart-5', - '--font-sans', - '--font-mono' + '--chart-5' ] as const export type NativeChatVisualTheme = { diff --git a/src/shared/plugins/artifacts/plugin-theme-token-reference-doc.ts b/src/shared/plugins/artifacts/plugin-theme-token-reference-doc.ts index 486c729877b..94bdd80a550 100644 --- a/src/shared/plugins/artifacts/plugin-theme-token-reference-doc.ts +++ b/src/shared/plugins/artifacts/plugin-theme-token-reference-doc.ts @@ -151,7 +151,10 @@ const APP_THEME_TOKENS: ReadonlySet = new Set(PLUGIN_APP_THEME_TOKENS) const isAppThemeToken = (token: string): token is PluginAppThemeToken => APP_THEME_TOKENS.has(token) // Frame variables that are not colours of an app theme. const FRAME_ONLY_ROLES: Record = { - '--radius': 'Corner radius of cards and controls' + '--radius': 'Corner radius of cards and controls', + '--font-sans': + 'Interface font stack. Fonts Orca loads itself (the default Geist, plugin fonts) are not in frames, so the next installed font in the stack is used', + '--font-mono': 'Monospace font stack for code' } /** The `--orca-*` CSS variables panel and editor frames get, with what each paints. */ @@ -181,7 +184,7 @@ export function renderPluginThemeTokenReference(): string { '', '## Frame CSS variables', '', - "Panel and custom editor frames get these stable variables, set from Orca's active theme and updated in place when it changes. Other tokens are not exposed to frames.", + "Panel and custom editor frames get these stable variables, set from Orca's active theme and fonts and updated in place when they change. Other tokens are not exposed to frames.", '', '| Variable | Orca token |', '| --- | --- |', diff --git a/src/shared/plugins/frames/plugin-panel-design-tokens.ts b/src/shared/plugins/frames/plugin-panel-design-tokens.ts index 76a0585ee74..4131c5d2eb7 100644 --- a/src/shared/plugins/frames/plugin-panel-design-tokens.ts +++ b/src/shared/plugins/frames/plugin-panel-design-tokens.ts @@ -22,5 +22,7 @@ export const PANEL_DESIGN_TOKEN_ALLOWLIST = [ '--border', '--input', '--ring', - '--radius' + '--radius', + '--font-sans', + '--font-mono' ] as const