mirror of
https://github.com/grafana/grafana.git
synced 2024-12-01 21:19:28 -06:00
Fix: Switch component not being styled as disabled when is checked (#80012)
* Fix Switch component not being styled as disabled when checked * Remove unnecessary code
This commit is contained in:
parent
0844b87b2f
commit
d29f9cfd3c
@ -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),
|
||||
|
Loading…
Reference in New Issue
Block a user