i am unable to overwrite default styles used by Material UI through my custom styles using css , below is the attached code for reference ,Kinldy guide what am i doing wrong or have missed ,Thanks in advance
React code from .jsx file
import "./StreamDashboard.css";
import { Button } from "@mui/material";
const StreamDashboard = () => {
return (
<div className="stream_container">
<Button className="config_button" variant="contained">
Edit Config
</Button>
</div>
);
};
export default StreamDashboard;
CSS code from .css file
.stream_container {
height: 100vh;
}
.config_button {
color: black;
background-color: yellow;
border-radius: 10px;
margin-top: 10px;
}
2
Answers
The way I import styles is like this:
then in code you can do this (for example):
file StreamDashboard.module.css contains:
So basically you have to import css styles with a name(in above example
styles
) and then get the classes usingstyles.css_class_name
Hope this helps.
Give it a shot and append in the end to every style you wanna override
!important