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:
@@ -1,4 +1,4 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<svg width="91" height="100" version="1.1" xmlns="http://www.w3.org/2000/svg">
|
||||
<path fill="#58a6ff" d="m45.601 1q20.993 0 33.71 15.946 10.799 13.625 10.799 31.287 0 12.414-5.9548 25.131-5.9548 12.717-16.451 19.176-10.395 6.4592-23.213 6.4592-20.892 0-33.205-16.653-10.395-14.029-10.395-31.489 0-12.717 6.2577-25.232 6.3584-12.616 16.653-18.57 10.295-6.0556 21.801-6.0556zm-3.128 6.5605q-5.3492 0-10.799 3.2296-5.3492 3.1287-8.68 11.102-3.3305 7.9735-3.3305 20.488 0 20.185 7.973 34.82 8.0743 14.634 21.195 14.634 9.7896 0 16.149-8.0743 6.3584-8.0743 6.3584-27.755 0-24.627-10.597-38.756-7.1657-9.6888-18.268-9.6888z"/>
|
||||
<path fill="#ffffff" d="m45.601 1q20.993 0 33.71 15.946 10.799 13.625 10.799 31.287 0 12.414-5.9548 25.131-5.9548 12.717-16.451 19.176-10.395 6.4592-23.213 6.4592-20.892 0-33.205-16.653-10.395-14.029-10.395-31.489 0-12.717 6.2577-25.232 6.3584-12.616 16.653-18.57 10.295-6.0556 21.801-6.0556zm-3.128 6.5605q-5.3492 0-10.799 3.2296-5.3492 3.1287-8.68 11.102-3.3305 7.9735-3.3305 20.488 0 20.185 7.973 34.82 8.0743 14.634 21.195 14.634 9.7896 0 16.149-8.0743 6.3584-8.0743 6.3584-27.755 0-24.627-10.597-38.756-7.1657-9.6888-18.268-9.6888z"/>
|
||||
</svg>
|
||||
|
||||
|
Before Width: | Height: | Size: 666 B After Width: | Height: | Size: 666 B |
@@ -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