Skip to content

Commit 33f799f

Browse files
authored
Add missing ToggleSwitch--checked styles (#2094)
* Add missing ToggleSwitch--checked styles * Add rule to override Catalyst's display: block
1 parent f740d00 commit 33f799f

File tree

2 files changed

+23
-0
lines changed

2 files changed

+23
-0
lines changed

.changeset/dirty-mails-stare.md

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@primer/css": patch
3+
---
4+
5+
Add missing ToggleSwitch--checked styles

src/toggle-switch/toggle-switch.scss

+18
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
// Catalyst in dotcom applies a display: block to all web component elements. This
2+
// rule overrides it so the status label and toggle switch are laid out correctly.
3+
.ToggleSwitch.ToggleSwitch {
4+
display: inline-flex;
5+
}
6+
17
.ToggleSwitch {
28
align-items: center;
39
display: inline-flex;
@@ -16,6 +22,18 @@
1622
}
1723
}
1824

25+
.ToggleSwitch--checked {
26+
.ToggleSwitch-statusOn {
27+
height: auto;
28+
visibility: visible;
29+
}
30+
31+
.ToggleSwitch-statusOff {
32+
height: 0;
33+
visibility: hidden;
34+
}
35+
}
36+
1937
.ToggleSwitch-track {
2038
position: relative;
2139
display: block;

0 commit comments

Comments
 (0)