Skip to content

Commit

Permalink
Add missing ToggleSwitch--checked styles (#2094)
Browse files Browse the repository at this point in the history
* Add missing ToggleSwitch--checked styles

* Add rule to override Catalyst's display: block
  • Loading branch information
camertron committed May 25, 2022
1 parent f740d00 commit 33f799f
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .changeset/dirty-mails-stare.md
@@ -0,0 +1,5 @@
---
"@primer/css": patch
---

Add missing ToggleSwitch--checked styles
18 changes: 18 additions & 0 deletions src/toggle-switch/toggle-switch.scss
@@ -1,3 +1,9 @@
// Catalyst in dotcom applies a display: block to all web component elements. This
// rule overrides it so the status label and toggle switch are laid out correctly.
.ToggleSwitch.ToggleSwitch {
display: inline-flex;
}

.ToggleSwitch {
align-items: center;
display: inline-flex;
Expand All @@ -16,6 +22,18 @@
}
}

.ToggleSwitch--checked {
.ToggleSwitch-statusOn {
height: auto;
visibility: visible;
}

.ToggleSwitch-statusOff {
height: 0;
visibility: hidden;
}
}

.ToggleSwitch-track {
position: relative;
display: block;
Expand Down

0 comments on commit 33f799f

Please sign in to comment.