fix: white favicon, sidebar active-state bug, app-wide pointer cursor
Three UI issues reported after the neutral-gray redesign: - favicon.svg was still filled #58a6ff (the pre-redesign accent blue); changed to white to match the sidebar logo mark. - Sidebar nav items all showed a filled background even when inactive. Root cause: sidebar-menu-button.svelte (and -sub-button) rendered `data-active="false"` as a literal attribute, but Tailwind's bare `data-active:` variant matches attribute *presence*, not value — so data-active:bg-sidebar-accent applied to every item regardless of state. Fixed by emitting the attribute only when active (`isActive || undefined`), a latent bug in the vendored shadcn component that read as intentional until flagged. - Tailwind's preflight resets <button> to cursor: default, so no button in the app showed a pointer. Added one base rule restoring cursor: pointer for buttons, [role=button], links, summary, and select (respecting :disabled / aria-disabled) rather than annotating each call site — covers new interactive elements automatically. Risk: reversible_low (UI-only). Verification: verified in the browser preview that inactive sidebar items are transparent (only the current page shows a background), nav buttons report cursor: pointer via computed styles, and the favicon renders white in the tab. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -107,6 +107,16 @@
|
||||
line-height: 1.4;
|
||||
-webkit-font-smoothing: antialiased;
|
||||
}
|
||||
/* Tailwind's preflight resets <button> to cursor: default; every button
|
||||
and native interactive element in this app is clickable, so restore
|
||||
the pointer cursor app-wide instead of annotating each one. */
|
||||
button:not(:disabled),
|
||||
[role='button']:not([aria-disabled='true']),
|
||||
a[href],
|
||||
summary,
|
||||
select {
|
||||
cursor: pointer;
|
||||
}
|
||||
}
|
||||
|
||||
#app {
|
||||
|
||||
@@ -61,7 +61,10 @@
|
||||
"data-slot": "sidebar-menu-button",
|
||||
"data-sidebar": "menu-button",
|
||||
"data-size": size,
|
||||
"data-active": isActive,
|
||||
// Tailwind's bare `data-active:` variant matches attribute *presence*,
|
||||
// not its value — omit the attribute entirely when false instead of
|
||||
// rendering data-active="false" (which the variant still matches).
|
||||
"data-active": isActive || undefined,
|
||||
...restProps,
|
||||
});
|
||||
</script>
|
||||
|
||||
@@ -25,7 +25,10 @@
|
||||
"data-slot": "sidebar-menu-sub-button",
|
||||
"data-sidebar": "menu-sub-button",
|
||||
"data-size": size,
|
||||
"data-active": isActive,
|
||||
// Tailwind's bare `data-active:` variant matches attribute *presence*,
|
||||
// not its value — omit the attribute entirely when false instead of
|
||||
// rendering data-active="false" (which the variant still matches).
|
||||
"data-active": isActive || undefined,
|
||||
...restProps,
|
||||
});
|
||||
</script>
|
||||
|
||||
Reference in New Issue
Block a user