[Slider] Customize disabled state
See original GitHub issueI have overridden the disabled state of Slider.
but I don’t know which syntax is correct:
const theme = createMuiTheme({
components: {
MuiSlider: {
styleOverrides: {
root: {
// case 1: Working
// "&.MuiSlider-root.Mui-disabled": {
// color: "red"
// }
// case 2: Not Working
"&.Mui-disabled": {
color: "red"
}
}
}
}
}
});
Usually, I use method 2. but it doesn’t seem to work in this case
More details:
https://codesandbox.io/s/continuousslider-material-demo-forked-3qphg
Issue Analytics
- State:
- Created 3 years ago
- Reactions:1
- Comments:17 (17 by maintainers)
Top Results From Across the Web
[Slider] Customize disabled state #25075 - mui/material-ui
I have overridden the disabled state of Slider. but I don't know which syntax is correct: const theme = createMuiTheme( ...
Read more >Enable & disable states in Flutter Slider widget - Syncfusion
Learn here all about the enabled and disabled states of the Syncfusion Flutter Slider (SfSlider) widget and how to customize them.
Read more >noUiSlider - Disabling, Updating and Styling - Refreshless.com
In-dept details on disabling slider handles, updating options and styling noUiSlider. ... CSS can be used to show the disabled state.
Read more >How to change material-ui slider thumb style when it's disabled
This is withStyle solution , where user can change the styling of slider and its sub component. Share.
Read more >Disabled State - Slider - Kendo UI for Angular - Telerik
You can enable or disable the Slider. To disable the component, set the disabled property to true . Example. View Source.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Agree, I’ll handle it next week
@mnajdova It works, you are right. So it’s not only an issue with the Button but with all the components. e.g. in the slider so the color wins over the root.
I would personally prefer option 3. It seems simpler, maybe a bit faster at runtime and prevent developer to mix nested selectors in the root with a slot. They have to pick one approach, which should avoid footguns: