Skip to content

Commit 0e5d70a

Browse files
committed
fix(docs): make the sidebar hover CSS agree with the utilities
Review caught that the sidebar hover alignment in this PR had no visual effect. `global.css` carries !important rules for both the link and button sidebar items — they exist to beat fumadocs' own styles — and they were still forcing the pre-alignment values: --surface-3 on an inactive hover, and --surface-active on an active hover. So the Tailwind utilities were dead on arrival. The global rules now carry the app's values instead (--surface-active inactive, --surface-6 active), matching the utilities rather than fighting them, with a comment noting the two must move together.
1 parent cb92a43 commit 0e5d70a

1 file changed

Lines changed: 6 additions & 4 deletions

File tree

apps/docs/app/global.css

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -462,16 +462,18 @@ html #nd-sidebar button[data-active="true"] {
462462
color: var(--text-body) !important;
463463
}
464464

465-
/* Hover state — platform --surface-3 */
465+
/* Hover state — the app's nav Chip hovers to --surface-active. These rules must
466+
carry !important to beat fumadocs' own sidebar styles, which also means they
467+
override the Tailwind hover utilities on the items; keep the two in step. */
466468
html #nd-sidebar a:not(:has(span.font-mono)):hover:not([data-active="true"]),
467469
html #nd-sidebar button:hover:not([data-active="true"]) {
468-
background-color: var(--surface-3) !important;
470+
background-color: var(--surface-active) !important;
469471
}
470472

471-
/* Active items don't change on hover */
473+
/* An active item darkens one surface on hover, matching the app's active Chip */
472474
html #nd-sidebar a[data-active="true"]:not(:has(span.font-mono)):hover,
473475
html #nd-sidebar button[data-active="true"]:hover {
474-
background-color: var(--surface-active) !important;
476+
background-color: var(--surface-6) !important;
475477
color: var(--text-body) !important;
476478
}
477479

0 commit comments

Comments
 (0)