i am trying to export a color from my .scss file to my React.
colors.scss
:root {
--color2: #606060;
}
$color: #88b5dd;
$color2: var(--color2);
.export {
color: $color
color2: $color2
}
and reading it in my React:
App.js
import {Colors} from './colors.scss'
console.log(Colors.color)
console.log(Colors.color2)
and in the console.log i can see:
#88b5dd
var(--color2)
color2 is not a color, the var(--color2) doesn't get interpolated when im using export anyone knows how to fix this issue ? how can i get the color defined in :root? thanks!
document.documentElement
– Reider:root
variables on the top of the file and styles. – Pulmotor