feat(renderer): body-class monospace toggle + CSS tokens

- useMonospaceClasses hook calls electronAPI.monospace.getSettings()
  and toggles body.mono-{jetbrains-mono,fira-code} and
  body.mono-ligatures-{on,off} classes
- Add --font-mono-active and --font-mono-feature tokens in globals.css
- Apply to code/pre/kbd/samp so all code rendering picks up the active
  monospace font + ligature settings
This commit is contained in:
2026-07-23 09:34:57 +05:30
parent b2ad8b8326
commit d29f19b1f5
4 changed files with 99 additions and 0 deletions
+19
View File
@@ -96,3 +96,22 @@
.cm-editor .cm-scroller {
@apply font-mono text-sm;
}
/* Monospace font + ligature tokens — driven by body.mono-* classes */
:root {
--font-mono-active: 'JetBrains Mono', 'SF Mono', Monaco, 'Courier New', monospace;
--font-mono-feature: 'liga' 0, 'calt' 0;
}
body.mono-fira-code {
--font-mono-active: 'Fira Code', 'JetBrains Mono', 'SF Mono', monospace;
}
body.mono-ligatures-on {
--font-mono-feature: 'liga' 1, 'calt' 1;
}
code,
pre,
kbd,
samp {
font-family: var(--font-mono-active);
font-feature-settings: var(--font-mono-feature);
}