diff --git a/packages/grafana-ui/src/components/Switch/Switch.tsx b/packages/grafana-ui/src/components/Switch/Switch.tsx index 95c401201c2..70e5167e63c 100644 --- a/packages/grafana-ui/src/components/Switch/Switch.tsx +++ b/packages/grafana-ui/src/components/Switch/Switch.tsx @@ -85,11 +85,6 @@ const getSwitchStyles = (theme: GrafanaTheme2, transparent?: boolean) => ({ zIndex: -1000, position: 'absolute', - '&:disabled + label': { - background: theme.colors.action.disabledBackground, - cursor: 'not-allowed', - }, - '&:checked + label': { background: theme.colors.primary.main, borderColor: theme.colors.primary.main, @@ -104,6 +99,22 @@ const getSwitchStyles = (theme: GrafanaTheme2, transparent?: boolean) => ({ }, }, + '&:disabled + label': { + background: theme.colors.action.disabledBackground, + borderColor: theme.colors.border.weak, + cursor: 'not-allowed', + + '&:hover': { + background: theme.colors.action.disabledBackground, + }, + }, + + '&:disabled:checked + label': { + '&::after': { + background: theme.colors.text.disabled, + }, + }, + '&:focus + label, &:focus-visible + label': getFocusStyles(theme), '&:focus:not(:focus-visible) + label': getMouseFocusStyles(theme),