Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 19 additions & 2 deletions packages/components/src/form-toggle/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ $toggle-border-width: 2px;
}
}

// checked state
// Checked state.
&.is-checked .components-form-toggle__track {
background-color: theme(toggle);
border: $toggle-border-width solid theme(toggle);
Expand All @@ -86,9 +86,15 @@ $toggle-border-width: 2px;
border: $toggle-border-width solid theme(toggle);
}
}

// Disabled state:
.components-disabled & {
opacity: 0.3;
}
}

.components-form-toggle__input[type="checkbox"] {
// This needs specificity to override inherited checkbox styles.
.components-form-toggle input.components-form-toggle__input[type="checkbox"] {
position: absolute;
top: 0;
left: 0;
Expand All @@ -98,6 +104,17 @@ $toggle-border-width: 2px;
margin: 0;
padding: 0;
z-index: z-index(".components-form-toggle__input");

// This overrides a border style that is inherited from parent checkbox styles.
border: none;
&:checked {
background: none;
}

// Don't show custom checkbox checkmark.
&::before {
content: "";
}
}

// Ensure on indicator works in normal and Windows high contrast mode both.
Expand Down