Skip to content

Commit eacd727

Browse files
committed
fix(css): Handle system auto-light mode for headerlink colors
The light mode override for headerlink colors used body:not([data-theme="dark"]) which incorrectly matches auto mode even when system is dark. Split into explicit light selector plus media query for auto + system light.
1 parent 2dfb044 commit eacd727

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

docs/_static/css/argparse-highlight.css

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -333,15 +333,26 @@ pre.argparse-usage {
333333

334334
/*
335335
* Light mode headerlink color overrides
336+
* Needed because code block has dark background regardless of theme
336337
*/
337-
body:not([data-theme="dark"]) .argparse-argument-name .headerlink {
338+
body[data-theme="light"] .argparse-argument-name .headerlink {
338339
color: #9ca0a5;
339340

340341
&:hover:not(:visited) {
341342
color: #cfd0d0;
342343
}
343344
}
344345

346+
@media (prefers-color-scheme: light) {
347+
body:not([data-theme="dark"]) .argparse-argument-name .headerlink {
348+
color: #9ca0a5;
349+
350+
&:hover:not(:visited) {
351+
color: #cfd0d0;
352+
}
353+
}
354+
}
355+
345356
/*
346357
* Highlight when targeted via URL fragment
347358
* Uses Furo's highlight-on-target color for consistency.

0 commit comments

Comments
 (0)