Skip to content

Speakr is a personal, self-hosted web application designed for transcribing audio recordings

Python

Fix queue #5 — sidebar + button (and other icon+colour-variant combos) no longer has dark icon on coloured background in light mode — .btn--icon was setting color: var(--text-muted) and a bg-tertiary hover background unconditionally, and since the rule sits AFTER .btn--primary in primitives.css the muted colour won the cascade whenever the two classes combined (sidebar's 'New' icon button is btn btn--primary btn--icon); now the muted text + bg-tertiary hover only apply when .btn--icon is not combined with a colour variant (.btn--primary / .btn--danger / .btn--ghost), so the bare icon-only button keeps its previous look and the combined buttons inherit their variant's foreground / background as intended; this also incidentally fixes the same dark-on-coloured issue on any other .btn--icon.btn--primary use site

Murtaza Nasirc3471b8b89c1
diff --git a/static/css/primitives.css b/static/css/primitives.css
index c4f97281..02601785 100644
--- a/static/css/primitives.css
+++ b/static/css/primitives.css
@@ -550,9 +550,17 @@ html.dark {
width: 36px;
min-height: 36px;
padding: 0;
+}
+/* Default colours for a bare .btn--icon (no colour variant). When
+ combined with .btn--primary / .btn--danger / .btn--ghost the
+ variant's own colour rules apply — otherwise the muted icon colour
+ below would override the variant's foreground (and the hover rule
+ would override its background), which produced a dark icon on a
+ coloured primary fill in light mode. */
+.btn--icon:not(.btn--primary):not(.btn--danger):not(.btn--ghost) {
color: var(--text-muted);
}
-.btn--icon:hover:not(:disabled) {
+.btn--icon:not(.btn--primary):not(.btn--danger):not(.btn--ghost):hover:not(:disabled) {
background: var(--bg-tertiary);
color: var(--text-primary);
}