Skip to content

Commit 8607047

Browse files
authored
style(fix[fonts]): Load all used font weights and replace unsupported 650 (#11)
Browsers were synthesizing font variants for two missing weights: `font-weight: 650` had no Fontsource file (falling back to synthetic bold), and weight 300 — used by Furo and sphinx-design for lighter text — was never loaded. - **IBM Plex Sans weights**: `[400, 500, 600, 700]` → `[300, 400, 500, 600, 700]` - **IBM Plex Mono weights**: `[400]` → `[300, 400]` - **Badge font-weight 650 → 700**: sphinx-autodoc-pytest-fixtures, sphinx-gptheme, and docs custom CSS
2 parents 7cf8037 + 556c48b commit 8607047

5 files changed

Lines changed: 16 additions & 5 deletions

File tree

CHANGES

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,17 @@ $ uv add gp-sphinx --prerelease allow
2828
return annotations — alias names are preserved and linked rather than
2929
expanding to the underlying union or generic type (#9)
3030

31+
### Bug fixes
32+
33+
- Load font weight 300 for IBM Plex Sans and IBM Plex Mono
34+
([Furo](https://github.com/pradyunsg/furo) and sphinx-design use
35+
`font-weight: 300` for lighter text, but the weight was never loaded,
36+
causing browsers to synthesize a light variant)
37+
- Replace `font-weight: 650` with `700` in badge CSS across
38+
`sphinx-autodoc-pytest-fixtures`, `sphinx-gptheme`, and docs (650 is not
39+
a standard Fontsource weight, so browsers were synthesizing bold instead
40+
of using the real font file)
41+
3142
### Workspace packages
3243

3344
- `sphinx-autodoc-pytest-fixtures` — Sphinx autodocumenter for pytest fixtures.

docs/_static/css/custom.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -395,7 +395,7 @@ h4:has(> .sd-badge[role="note"][aria-label^="Safety tier:"]) {
395395

396396
.sd-badge[role="note"][aria-label^="Safety tier:"] {
397397
gap: 0.28rem;
398-
font-weight: 650;
398+
font-weight: 700;
399399
letter-spacing: 0.01em;
400400
border: 1px solid transparent;
401401
}

packages/gp-sphinx/src/gp_sphinx/defaults.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -195,15 +195,15 @@ class FontConfig(_FontConfigRequired, total=False):
195195
"family": "IBM Plex Sans",
196196
"package": "@fontsource/ibm-plex-sans",
197197
"version": "5.2.8",
198-
"weights": [400, 500, 600, 700],
198+
"weights": [300, 400, 500, 600, 700],
199199
"styles": ["normal", "italic"],
200200
"subset": "latin",
201201
},
202202
{
203203
"family": "IBM Plex Mono",
204204
"package": "@fontsource/ibm-plex-mono",
205205
"version": "5.2.7",
206-
"weights": [400],
206+
"weights": [300, 400],
207207
"styles": ["normal", "italic"],
208208
"subset": "latin",
209209
},

packages/sphinx-autodoc-pytest-fixtures/src/sphinx_autodoc_pytest_fixtures/_static/css/sphinx_autodoc_pytest_fixtures.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,7 @@ dl.py.fixture > dt .spf-badge-group {
183183
position: relative; /* positioning context for the CSS-only tooltip */
184184
display: inline-block;
185185
font-size: var(--spf-badge-font-size, 0.67rem);
186-
font-weight: 650;
186+
font-weight: 700;
187187
line-height: normal;
188188
letter-spacing: 0.01em;
189189
padding: var(--spf-badge-padding-v, 0.16rem) 0.5rem;

packages/sphinx-gptheme/src/sphinx_gptheme/theme/static/css/custom.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -271,7 +271,7 @@ h4:has(> .sd-badge[role="note"][aria-label^="Safety tier:"]) {
271271

272272
.sd-badge[role="note"][aria-label^="Safety tier:"] {
273273
gap: 0.28rem;
274-
font-weight: 650;
274+
font-weight: 700;
275275
letter-spacing: 0.01em;
276276
border: 1px solid transparent;
277277
}

0 commit comments

Comments
 (0)