For using native css variables in React:
Let's say you want to toggle between light and dark themes for any text nodes in a certain element:
const LightDarkSpan = ({ children }) => (
<span style={{
color: 'var(--text-color, black)'
}}>
{children}
</span>
);
Then, any parent can set that variable, and it effectively acts as context to any child element that explicitly chooses to use that specific CSS variable:
// rendered
<div style={{
backgroundColor: 'black',
'--text-color': 'white'
}}>
<article>
<LightDarkSpan>testing</LightDarkSpan>
</article>
</div>
Reference
<p style={{ color: tertiary-col }}>.. .but I dont think "tertiary-col" is a valid variable name