feat(typography): establish three-font contract (#5918)
* feat(typography): establish three-font contract Assisted-by: Hermes Agent:gpt-5.6-sol Assisted-by: OpenCode:gpt-5.3-codex-spark Assisted-by: Claude Code:claude-opus-4-8 Assisted-by: Codex:gpt-5.3-codex-spark * fix(terminal): refit after live font changes Assisted-by: Hermes Agent:gpt-5.6-sol Assisted-by: OpenCode:gpt-5.3-codex-spark Assisted-by: Claude Code:claude-opus-4-8 * docs(typography): preserve global serif guardrail Assisted-by: Hermes Agent:gpt-5.6-sol Assisted-by: Claude Code:claude-opus-4-8 * fix(typography): enforce font tokens in rendered editors Assisted-by: Hermes Agent:gpt-5.6-sol Assisted-by: Codex:gpt-5.3-codex-spark * fix(terminal): resync after stylesheet font changes Observe live extension stylesheet changes and completed stylesheet loads so open terminals refresh font metrics and backend dimensions. Assisted-by: Hermes Agent:gpt-5.6-sol Assisted-by: Codex:gpt-5.3-codex-spark Assisted-by: Greptile:undisclosed * test(typography): remove dynamic harness execution Assisted-by: Hermes Agent:gpt-5.6-sol Assisted-by: Codex:gpt-5.3-codex-spark Assisted-by: nesquena-hermes:undisclosed * test(typography): skip missing Playwright browser Assisted-by: Hermes Agent:gpt-5.6-sol Assisted-by: Codex:gpt-5.6-luna Assisted-by: nesquena-hermes:undisclosed * fix(terminal): refit after web fonts load Assisted-by: Hermes Agent:gpt-5.6-sol Assisted-by: Codex:gpt-5.6-luna Assisted-by: Greptile:undisclosed --------- Co-authored-by: nesquena-hermes <nesquena+hermes@gmail.com>
This commit is contained in:
1 parent
84f9be2088
commit
1480718767
11 files changed
+1083
-75
No files matched your search
@@ -144,6 +144,36 @@ font size. Persists alongside theme and skin.
|
||||
|
||||
---
|
||||
|
||||
## Typography Tokens
|
||||
|
||||
The three font tokens are declared in `static/style.css`:
|
||||
|
||||
- `--font-ui`: user interface chrome, controls, composer chrome, labels, and
|
||||
ordinary non-code UI text
|
||||
- `--font-conversation`: user/assistant message prose
|
||||
- `--font-mono`: code, tool details, logs, identifiers, and terminal text
|
||||
|
||||
By default:
|
||||
|
||||
```css
|
||||
--font-conversation: var(--font-ui);
|
||||
--font-mono: ui-monospace,"SFMono-Regular","SF Mono",Menlo,Consolas,"Liberation Mono",monospace;
|
||||
```
|
||||
|
||||
For CSS-based custom skins and extension stylesheets/scripts, override the three
|
||||
font tokens directly (`--font-ui`, `--font-conversation`, `--font-mono`) on the
|
||||
skin root (`:root[data-skin="..."]`), including any mode-specific variant.
|
||||
`window.registerHermesSkin()` currently accepts only the documented design-token
|
||||
allowlist (no `--font-*` tokens), so custom font families should be supplied via
|
||||
CSS rather than skin registration.
|
||||
|
||||
Leaving `--font-conversation` untouched keeps prose coupled to `--font-ui`;
|
||||
override it only when a different reading face is explicitly required. Avoid
|
||||
hard-coded selector-level font declarations when one of these tokens already
|
||||
expresses the intent.
|
||||
|
||||
---
|
||||
|
||||
## How It Works Internally
|
||||
|
||||
1. **Theme:** `document.documentElement.classList.toggle('dark', isDark)` —
|
||||
|
||||
Reference in new issue
Block a user