Commit dde46cf
committed
fix(docs-autogen): scale source-link icon with heading font size
mdxify hardcodes `style="width: 14px; height: 14px;"` on the GitHub
Icon component. Inline styles win over the stylesheet, so the icon
rendered at a fixed 14 px regardless of whether it appeared in an h2,
h3, or h4 heading.
Add a `normalize_icon_size` pass to decorate_api_mdx.py that replaces
the pixel dimensions with `0.85em` so the icon scales with the
surrounding heading's font size. Remove the now-redundant CSS
width/height rules on `article h* sup svg` — the inline style is the
single source of truth for icon sizing.
Also add a mypy override to suppress the pre-existing import-not-found
error for `cpex`, a private optional dependency not available in all
environments.
Assisted-by: Claude Code1 parent 2c2ed7e commit dde46cf
3 files changed
Lines changed: 36 additions & 7 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
115 | 115 | | |
116 | 116 | | |
117 | 117 | | |
118 | | - | |
| 118 | + | |
119 | 119 | | |
120 | 120 | | |
121 | 121 | | |
122 | 122 | | |
123 | 123 | | |
124 | 124 | | |
125 | | - | |
126 | | - | |
127 | | - | |
128 | | - | |
129 | | - | |
130 | | - | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
312 | 312 | | |
313 | 313 | | |
314 | 314 | | |
| 315 | + | |
| 316 | + | |
| 317 | + | |
| 318 | + | |
| 319 | + | |
315 | 320 | | |
316 | 321 | | |
317 | 322 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
| 14 | + | |
14 | 15 | | |
15 | 16 | | |
16 | 17 | | |
| |||
123 | 124 | | |
124 | 125 | | |
125 | 126 | | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
126 | 153 | | |
127 | 154 | | |
128 | 155 | | |
| |||
856 | 883 | | |
857 | 884 | | |
858 | 885 | | |
| 886 | + | |
| 887 | + | |
| 888 | + | |
859 | 889 | | |
860 | 890 | | |
861 | 891 | | |
| |||
0 commit comments