Skip to content

Commit 9d9d74f

Browse files
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

packages/sphinx-autodoc-typehints-gp/src/sphinx_autodoc_typehints_gp/_static/css/typehints_gp.css

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -43,13 +43,16 @@
4343
* up monospace from Furo's `code.literal` rule in
4444
* gp-furo-theme/.../code.css; no extra rule needed here. */
4545

46-
/* Defensive: blocks Furo's `code.literal { font-size: 81.25% }`
47-
* from compounding inside field-list rows. Keeps inline xref
48-
* code at the row's inherited size instead of shrinking on top. */
46+
/* Furo's `code.literal` chip styling (background, padding,
47+
* border-radius) acts as a cognitive container around each type
48+
* identifier — preferred to a transparent inline link. Pin the
49+
* size to a root-relative `0.8125rem` so chips render at ≈ 13 px
50+
* regardless of the row's metadata-size parent. Furo's own
51+
* `code.literal { font-size: 81.25% }` would otherwise compound
52+
* to ~11.4 px against a 14 px parent (too small); using `rem`
53+
* blocks the compounding while still scaling with the root clamp
54+
* ramp on wide viewports. */
4955
.field-list code.literal {
50-
background: transparent;
51-
border: none;
52-
padding: 0;
53-
font-size: inherit;
56+
font-size: 0.8125rem;
5457
}
5558
}

0 commit comments

Comments
 (0)