I was wondering if it's possible to apply a style to a child element only, using MakesStyles, for example in a normal HTML/CSS project:
<div className="parent">
<h1>Title!</h1>
</div>
.parent h1 {
color: #f00;
}
This would color every title inside the div.
I have tried a few differnt ways, one of them was this:
// Function
const { parent } = homeStyle()
return (
<div className={parent}>
<h1>Title!</h1>
</div>
)
// Style
const homeStyle = makeStyles(theme => ({
parent: {
background: "#fff",
h1: {
color: "#f00",
}
},
}))
But it didn't work.
