Skip to content

Commit 652ae00

Browse files
committed
fix(theme): mobile TOC caret + sidebar panel theming
- Mobile TOC ('On this page') caret now points right when collapsed and down when expanded. Default theme assumes an up-arrow icon, but our --ifm-menu-link-sublist-icon is a right-chevron, so default rotation produced left/right instead of right/down. - Mobile slide-in sidebar background was inheriting the blue navbar. Override to --ifm-background-surface-color (white / #242526) so the panel matches the page surface, not the navbar. - Brand row inside the mobile panel: site title was white-on-blue and blended into the new white background. Force dark gray, kill hover color shift. Close button (X) gets the same treatment.
1 parent 4a71b22 commit 652ae00

1 file changed

Lines changed: 48 additions & 0 deletions

File tree

src/css/custom.css

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -340,6 +340,19 @@ aside.theme-doc-sidebar-container > div {
340340
background: transparent !important;
341341
}
342342

343+
/* Mobile TOC ("On this page") collapse caret.
344+
Theme uses CSS modules with hashed class names. Wrapper has stable
345+
`.theme-doc-toc-mobile` + hashed `tocCollapsibleExpanded` (only when
346+
open). Default theme assumes up-arrow icon (collapsed=180=down,
347+
expanded=0=up), but our --ifm-menu-link-sublist-icon is a right-
348+
chevron. Override: collapsed = right (0deg), expanded = down (90deg). */
349+
.theme-doc-toc-mobile > button::after {
350+
transform: rotate(0deg) !important;
351+
}
352+
.theme-doc-toc-mobile[class*='Expanded'] > button::after {
353+
transform: rotate(90deg) !important;
354+
}
355+
343356
/* Vercel-style sidebar items: hover/active bg stretches edge-to-edge
344357
within the sidebar column (including the chevron area for sub-cats),
345358
matching width across leaf links and sub-category headers. */
@@ -476,6 +489,41 @@ html[data-theme='dark'] .theme-doc-sidebar-container {
476489
border-right-color: var(--ifm-color-emphasis-200);
477490
}
478491

492+
/* Mobile slide-in sidebar (hamburger menu).
493+
Infima defaults the panel background to --ifm-navbar-background-color,
494+
which we've set to blue. Override to match the page surface.
495+
`--ifm-background-color` is `transparent` in Infima's light theme, so we
496+
use `--ifm-background-surface-color` (white in light, #242526 in dark)
497+
which is the panel/card surface variable. */
498+
.navbar-sidebar {
499+
background-color: var(--ifm-background-surface-color) !important;
500+
}
501+
.navbar-sidebar__items {
502+
background-color: var(--ifm-background-surface-color);
503+
}
504+
.navbar-sidebar .menu__link,
505+
.navbar-sidebar .navbar-sidebar__back {
506+
color: var(--ifm-menu-color);
507+
}
508+
.navbar-sidebar .navbar__link {
509+
color: var(--ifm-font-color-base);
510+
}
511+
512+
/* Brand row inside the mobile panel: site title was inheriting the
513+
navbar's white-on-blue color and blending into the now-white panel.
514+
Force a dark gray and kill the hover color shift so it stays put. */
515+
.navbar-sidebar__brand .navbar__brand,
516+
.navbar-sidebar__brand .navbar__title,
517+
.navbar-sidebar__brand .navbar__brand:hover,
518+
.navbar-sidebar__brand .navbar__title:hover {
519+
color: var(--ifm-color-emphasis-800) !important;
520+
}
521+
522+
/* Close button (X) on the brand row — also white-on-blue by default */
523+
.navbar-sidebar__close {
524+
color: var(--ifm-color-emphasis-800);
525+
}
526+
479527
/* Pagination (prev/next links at bottom of doc): drop the boxed border so
480528
the links read as plain text, matching the cleaner look of the rest of
481529
the doc. Padding pulled in too — without a border there's no need for

0 commit comments

Comments
 (0)