diff --git a/menu/satus.css b/menu/satus.css index afbb3eddf..8fb0322fd 100644 --- a/menu/satus.css +++ b/menu/satus.css @@ -2,7 +2,7 @@ .satus-section--card:hover, .satus-select:hover, .satus-switch:hover, .satus-switch__content:hover {transition: background-color 0.08s ease-out !important;} *[data-value][data-value="false"] {margin-bottom: 0; margin-top: 0; transition: margin 0.14s linear !important;} -*[data-value][data-value="true"] {margin-bottom: -4.5px !important; margin-top: -3.5px; transition: margin 0.2s linear !important;} +*:not(.satus-switch)[data-value][data-value="true"] {margin-bottom: -4.5px !important; margin-top: -3.5px; transition: margin 0.2s linear !important;} .satus-button--general, .satus-button--appearance, .satus-button--player { margin-left: 9px !important; diff --git a/tests/unit/switch-spacing.test.js b/tests/unit/switch-spacing.test.js new file mode 100644 index 000000000..cffa47498 --- /dev/null +++ b/tests/unit/switch-spacing.test.js @@ -0,0 +1,12 @@ +const fs = require('fs'); +const path = require('path'); + +describe('Switch row spacing', () => { + test('does not compact enabled switch rows', () => { + const css = fs.readFileSync(path.join(__dirname, '../../menu/satus.css'), 'utf8'); + const compactEnabledRule = css.match(/([^{}]+)\{[^{}]*margin-bottom:\s*-4\.5px[^{}]*margin-top:\s*-3\.5px[^{}]*\}/); + + expect(compactEnabledRule).not.toBeNull(); + expect(compactEnabledRule[1]).toContain(':not(.satus-switch)'); + }); +});