Skip to content

Commit f7173bb

Browse files
committed
style(docs): Underline badge links only on hover, exclude gap and badge
why: Links containing tool badges had an underline spanning the code text, the space, and the badge. Looks cleaner with underline only on the code portion, only on hover. what: - Remove text-decoration from <a> elements containing badges - Apply underline only to the <code> child, only on :hover - Badge and gap between code and badge never underlined
1 parent bba2608 commit f7173bb

1 file changed

Lines changed: 20 additions & 0 deletions

File tree

docs/_static/css/custom.css

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -237,8 +237,28 @@ img[src*="codecov.io"] {
237237
* Badges appear inline in both h2/h3 headings and body text.
238238
* Pin size to body-text scale so they don't inflate in headings.
239239
* Vertical-align keeps them centered with adjacent text.
240+
*
241+
* Links containing badges: underline only the code text, not
242+
* the gap or badge itself. Achieved by moving text-decoration
243+
* from the <a> to its <code> child.
240244
* ────────────────────────────────────────────────────────── */
241245
.sd-badge {
242246
font-size: 0.75rem;
243247
vertical-align: middle;
244248
}
249+
250+
a.reference .sd-badge {
251+
text-decoration: none;
252+
}
253+
254+
a.reference:has(.sd-badge) {
255+
text-decoration: none;
256+
}
257+
258+
a.reference:has(.sd-badge) code {
259+
text-decoration: none;
260+
}
261+
262+
a.reference:has(.sd-badge):hover code {
263+
text-decoration: underline;
264+
}

0 commit comments

Comments
 (0)