Skip to content

Commit aac36c6

Browse files
committed
style(theme[links]): Restore code-only underline for safety badge links
why: gp-sphinx currently underlines the inter-element gap and misaligns code and badges, regressing libtmux-mcp's previous docs behavior. what: - remove anchor-level underlines for reference links that contain Safety tier badges - reapply hover underline only to the code token inside those links - vertically align code and safety badges so inline tool links sit on one baseline
1 parent d529b8e commit aac36c6

2 files changed

Lines changed: 48 additions & 0 deletions

File tree

docs/_static/css/custom.css

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -457,6 +457,30 @@ code.docutils + .sd-badge[role="note"][aria-label^="Safety tier:"],
457457
margin-left: 0.4em;
458458
}
459459

460+
/* ── Safety badge link behavior ────────────────────────────
461+
* Keep docs-site previews aligned with the packaged theme:
462+
* tool links underline only the code token, not the gap or
463+
* the attached safety badge.
464+
* ────────────────────────────────────────────────────────── */
465+
a.reference:has(.sd-badge[role="note"][aria-label^="Safety tier:"]) {
466+
text-decoration: none;
467+
}
468+
469+
a.reference:has(.sd-badge[role="note"][aria-label^="Safety tier:"])
470+
.sd-badge[role="note"][aria-label^="Safety tier:"] {
471+
text-decoration: none;
472+
vertical-align: middle;
473+
}
474+
475+
a.reference:has(.sd-badge[role="note"][aria-label^="Safety tier:"]) code {
476+
text-decoration: none;
477+
vertical-align: middle;
478+
}
479+
480+
a.reference:has(.sd-badge[role="note"][aria-label^="Safety tier:"]):hover code {
481+
text-decoration: underline;
482+
}
483+
460484
/* Type badges (solid fills) — muted gray, scoped to metadata strip only.
461485
* extension: {bdg-primary} → .sd-badge.sd-bg-primary
462486
* coordinator: {bdg-success} → .sd-badge.sd-bg-success (solid fill)

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

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -333,6 +333,30 @@ code.docutils + .sd-badge[role="note"][aria-label^="Safety tier:"],
333333
margin-left: 0.4em;
334334
}
335335

336+
/* ── Safety badge link behavior ────────────────────────────
337+
* When a tool link includes inline code plus a safety badge,
338+
* keep the hover underline on the code token only so the gap
339+
* and badge do not get decorated.
340+
* ────────────────────────────────────────────────────────── */
341+
a.reference:has(.sd-badge[role="note"][aria-label^="Safety tier:"]) {
342+
text-decoration: none;
343+
}
344+
345+
a.reference:has(.sd-badge[role="note"][aria-label^="Safety tier:"])
346+
.sd-badge[role="note"][aria-label^="Safety tier:"] {
347+
text-decoration: none;
348+
vertical-align: middle;
349+
}
350+
351+
a.reference:has(.sd-badge[role="note"][aria-label^="Safety tier:"]) code {
352+
text-decoration: none;
353+
vertical-align: middle;
354+
}
355+
356+
a.reference:has(.sd-badge[role="note"][aria-label^="Safety tier:"]):hover code {
357+
text-decoration: underline;
358+
}
359+
336360
/* ── View Transitions (SPA navigation) ────────────────────
337361
* Crossfade between pages during SPA navigation.
338362
* Browsers without View Transitions API get instant swap.

0 commit comments

Comments
 (0)