File tree Expand file tree Collapse file tree 1 file changed +26
-0
lines changed
Expand file tree Collapse file tree 1 file changed +26
-0
lines changed Original file line number Diff line number Diff line change 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 ;
You can’t perform that action at this time.
0 commit comments