Currently, I am using Material UI components but I want to streamline my styles by moving them all into a .scss file. Right now, I have a significant styles object within the same JavaScript file where I am utilizing the Material UI components. This styles object is passed to the Material UI components through the style prop, essentially resulting in inline styling. My aim is to eliminate this practice. Additionally, I have nested components (both Material UI and custom React ones) within these Material UI components.
const styles= {//my css styles go here}
<TableRowColumn key={index} style={styles.column}>
<span className="checkbox-thing">
<input
....
/>
</span>
</TableRowColumn>
I have looked at the override documentation: Material UI Next Customization Overrides
I also came across this Stack Overflow question: How to style material ui next components with styled components and SASS
In my opinion, neither of these resources provides clear guidance on how to use an external .scss file to store styles and then reference those class names within the Material UI component. Ideally, I would like to achieve something similar to working with normal HTML elements:
<input
type="checkbox"
checked={
this.props.isChecked
}
className="someClassInTheSCSSFile"
/>
To sum up, my goals are:
Move my large styles object into separate classes in a .scss file
Reference a class from the .scss file and apply it to a Material UI component