Skip to content

Commit 5e27d89

Browse files
committed
address diff between local build and vercel.
Signed-off-by: bgravenorst <[email protected]>
1 parent 3941f5b commit 5e27d89

File tree

1 file changed

+26
-0
lines changed

1 file changed

+26
-0
lines changed

src/scss/theme/_sidebar.scss

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -274,6 +274,32 @@
274274
}
275275
}
276276

277+
/**
278+
* Vercel-only "overlap" on level 2+ was observed on active (non-collapsible) link rows.
279+
* Those rows are plain `li > a.menu__link--active` (no `.menu__list-item--active` class),
280+
* so if the anchor ever ends up shrink-to-fit, the background gradient will look clipped
281+
* / visually inconsistent.
282+
*
283+
* Fix: apply the active background to the full-width `li` instead of the `a`.
284+
* We keep this gated behind `:has()` support; without it, behavior remains unchanged.
285+
*/
286+
@supports selector(:has(*)) {
287+
&__list-item:has(> a.menu__link.menu__link--active) {
288+
background-color: transparent;
289+
background-image: linear-gradient(
290+
to right,
291+
transparent 0,
292+
transparent 0.5rem,
293+
var(--ifm-menu-color-background-active, var(--ifm-hover-overlay)) 0.5rem
294+
);
295+
}
296+
297+
/* Avoid double-highlighting: the `li` owns the active background in modern browsers. */
298+
&__list-item:has(> a.menu__link.menu__link--active) > a.menu__link.menu__link--active {
299+
background-image: none;
300+
}
301+
}
302+
277303
&__caret {
278304
padding: 1rem 2rem 1rem 1rem;
279305
opacity: 0.25;

0 commit comments

Comments
 (0)