Skip to content
Open
Show file tree
Hide file tree
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
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,12 @@
--switch-cursor: not-allowed;
}

.input:checked:disabled + &,
.input:checked[data-disabled] + & {
--switch-bg: var(--switch-color);
opacity: 0.35;
}

@mixin light {
--switch-bg: var(--mantine-color-gray-3);
--switch-text-color: var(--mantine-color-gray-6);
Expand Down
2 changes: 2 additions & 0 deletions packages/@mantine/core/src/components/Switch/Switch.story.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ export function WithinDisabledFieldset() {
<legend>Disabled fieldset</legend>
<Switch label="Disabled by fieldset" />
<Switch label="Disabled by prop" disabled mt="md" />
<Switch label="Disabled by fieldset (checked)" checked mt="md" />
<Switch label="Disabled by prop (checked)" checked disabled mt="md" />
</fieldset>
);
}
Expand Down