Commit 9d9d74f
committed
typehints-gp(css[code-chip]) Restore Furo chip styling on field-list code; pin to 0.8125rem
why: External CSS expert recommendation #4. The previous
neutralisation rule (`.field-list code.literal { background:
transparent; padding: 0; border: none; font-size: inherit }`)
existed to stop Furo's percentage chip rule from compounding to
~10.5 px when the field body was pinned to 13 px. Now that
field-body is back at metadata-size (14 px) — see commit FE1 — a
13 px chip with light-gray background and padding **is** the right
size: it acts as a cognitive container around each type identifier
without overwhelming the row.
what:
- Delete the chip-strip block (background/padding/border/font-size
all reset to inherit). Furo's `code.literal { background: var(...);
padding: 0.1em 0.2em; border-radius: 0.2em; font-size: 81.25% }`
rule now fires unmodified for inline code in field-list rows.
- Add a single-line size pin: `.field-list code.literal { font-size:
0.8125rem }`. This overrides Furo's percentage size with a root-
relative rem so chips render at ≈13 px regardless of the row's
metadata-size parent. Without the pin, 14 px parent × 81.25 % =
~11.4 px (too small).
- Keep `.default_value code.literal { font-size: inherit; ...}` —
signature default-value surface, different cascade, unaffected.
verification: at 1280 px on the typehints-gp examples page,
getComputedStyle('dl.field-list code.literal') returns fontSize
13 px, fontFamily "IBM Plex Mono", backgroundColor rgb(248, 249, 251)
(Furo's --color-background-secondary), borderTopLeftRadius 2.6 px,
paddingTop 1.3 px, paddingLeft 2.6 px (Furo's 0.1em 0.2em).1 parent 2c0ad10 commit 9d9d74f
1 file changed
Lines changed: 10 additions & 7 deletions
File tree
- packages/sphinx-autodoc-typehints-gp/src/sphinx_autodoc_typehints_gp/_static/css
Lines changed: 10 additions & 7 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
43 | 43 | | |
44 | 44 | | |
45 | 45 | | |
46 | | - | |
47 | | - | |
48 | | - | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
49 | 55 | | |
50 | | - | |
51 | | - | |
52 | | - | |
53 | | - | |
| 56 | + | |
54 | 57 | | |
55 | 58 | | |
0 commit comments