fix: prevent toggle switches from shrinking when set to 'on' (Fixes #4216) - #4253
Open
waterWang wants to merge 1 commit into
Open
fix: prevent toggle switches from shrinking when set to 'on' (Fixes #4216)#4253waterWang wants to merge 1 commit into
waterWang wants to merge 1 commit into
Conversation
…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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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"]inmenu/satus.cssapplies negative margins (margin-bottom: -4.5pxandmargin-top: -3.5px) to all elements withdata-value="true". Toggle switches ( elements) also use thedata-valueattribute 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:
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
data-valueelements