Skip to content

fix: prevent toggle switches from shrinking when set to 'on' (Fixes #4216) - #4253

Open
waterWang wants to merge 1 commit into
code-charity:masterfrom
waterWang:fix/settings-toggle-narrow-4216
Open

fix: prevent toggle switches from shrinking when set to 'on' (Fixes #4216)#4253
waterWang wants to merge 1 commit into
code-charity:masterfrom
waterWang:fix/settings-toggle-narrow-4216

Conversation

@waterWang

Copy link
Copy Markdown

Bug Description

When any toggle in the settings menu is set to "on", the corresponding menu entry becomes narrower. This is a visual regression that affects all toggle switches in the extension's settings UI.

Root Cause

The universal CSS selector *[data-value][data-value="true"] in menu/satus.css applies negative margins (margin-bottom: -4.5px and margin-top: -3.5px) to all elements with data-value="true". Toggle switches ( elements) also use the data-value attribute to indicate their on/off state. When a toggle is turned on, the negative margins compress the switch vertically, which in turn makes the entire menu entry row appear narrower.

Fix

Added a more specific CSS rule:

.satus-switch[data-value] {
    margin-bottom: 0 !important;
    margin-top: 0 !important;
}

This overrides the universal selector's negative margins specifically for toggle switch elements, preventing them from being shrunk while preserving the original behavior for other elements that use data-value.

Testing

  • Tested with toggle switches in settings (on/off states)
  • Verified no visual change for other data-value elements
  • Works in both light and dark themes

…ode-charity#4216)

The universal *[data-value][data-value="true"] selector in satus.css
applied negative margins to ALL elements with data-value="true",
including toggle switches (.satus-switch). When a toggle was turned on,
the negative margins compressed the switch vertically, making the
entire menu entry row appear narrower.

Fix: add .satus-switch[data-value] rule to reset margins to 0,
overriding the universal selector's negative margins.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant