fix(ui): make .hidden work on icon SVGs (remove display:inline-block)
The .icon CSS rule had display:inline-block, which had higher source-order priority than Tailwind's .hidden (display:none). Both have the same specificity, but .icon was declared later in the compiled CSS, so it overrode .hidden. Result: both moon and sun SVGs in the theme toggle were always visible, making them appear side-by-side (flex) or stacked (grid) instead of swapping cleanly between light and dark mode. Fix: remove display:inline-block from .icon. SVGs default to inline and still respect width:1em / height:1em correctly. Now .hidden and .dark\:block work as intended, and only one icon is visible at a time, perfectly centered in the button.
This commit is contained in:
@@ -123,7 +123,6 @@
|
||||
.icon {
|
||||
width: 1em;
|
||||
height: 1em;
|
||||
display: inline-block;
|
||||
vertical-align: -0.125em;
|
||||
fill: currentColor;
|
||||
}
|
||||
@@ -30,7 +30,6 @@ body.modal-open {
|
||||
.icon {
|
||||
width: 1em;
|
||||
height: 1em;
|
||||
display: inline-block;
|
||||
vertical-align: -0.125em;
|
||||
fill: currentColor;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user