Commit 4f96f6d
authored
v6: Make the font-size setting reach body text (#4427)
## Summary
- `--font-size-body` is declared twice: as a scaling preset token in
`tokens.css` (`:root,
[data-font-size='default'|'compact'|'large'|'xl']`), and as a frozen v5
value in `root.css`'s DEPRECATED `.graphiql-container` block. Both
selectors have specificity (0,1,0) and the frozen block comes later
(after `@import 'tokens.css'`), so `calc(15rem / 16)` always won.
- Every consumer of `var(--font-size-body)` — the `.graphiql-container`
base font-size, `button`, `dialog`, `dropdown-menu`, `top-bar`, and the
collections / doc-explorer / query-builder plugins — has silently been
pinned to 15px, so Settings > Font size never touched body text even
though the code looked correct. The sibling preset tokens
(`--font-size-small`, `--font-size-mono`, `--font-size-eyebrow`) were
unaffected because they aren't redeclared in that block.
- Renaming the frozen declaration separates the two meanings and lets
the preset token win.
## Changes
- `root.css`: renamed `--font-size-body: calc(15rem / 16)` to
`--font-size-body-legacy` in the DEPRECATED `.graphiql-container` block.
- `graphiql-plugin-code-exporter/src/index.css`: pointed the
CodeMirror-based plugin at `var(--font-size-body-legacy)` so it keeps
rendering at the frozen 15px.
- Updated the DEPRECATED block comment to name the code-exporter plugin
— the explorer plugin it referenced no longer consumes this token.
## Validation Steps
1. Open the app and note the size of body text (panel headers, buttons,
top bar, doc explorer rows).
2. Open Settings > Font size and switch to **Large**, then **Extra
large**. Body text throughout the app should visibly grow at each step —
previously it stayed fixed at 15px regardless.
3. Switch to **Compact**. Body text should visibly shrink.
4. Switch back to **Default** and confirm body text settles at the
standard size (slightly smaller than before this change).
5. Open the code exporter plugin and cycle through the font-size
presets. Its exported-code panel should stay the same size at every
preset — it intentionally remains frozen.1 parent ff2e4ca commit 4f96f6d
2 files changed
Lines changed: 4 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
24 | 24 | | |
25 | 25 | | |
26 | 26 | | |
27 | | - | |
| 27 | + | |
28 | 28 | | |
29 | 29 | | |
30 | 30 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
13 | 13 | | |
14 | 14 | | |
15 | 15 | | |
16 | | - | |
| 16 | + | |
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
| |||
36 | 36 | | |
37 | 37 | | |
38 | 38 | | |
39 | | - | |
| 39 | + | |
| 40 | + | |
40 | 41 | | |
41 | 42 | | |
42 | 43 | | |
| |||
0 commit comments