I am facing a challenge with using the direct descendant CSS selector within a React inline style element:
<style>{`
.something>div{
color: blue;
}
`}</style>
While this works fine in development, in production React replaces > with gt;
, causing issues with my CSS.
Is there a way to achieve direct descendant styling in a React inline style element?
Alternatively, how can I make sure React treats the innerHTML as literal?
In my React app built with Gatsby, I have multiple files and pages where I need different CSS styles. However, due to restrictions in Gatsby, it is challenging to achieve this. Additionally, since I am using nested React components, modifying node_modules to assign classes to nested components is not ideal. Any suggestions on how to work around these limitations would be appreciated.