You can’t just add a SCSS variable as a CSS variable in :root
scope like this:
--my-var: #$myVar;
Having #
and $
together causes a parsing error. Instead, express your variable this way (note the use of curly brackets):
--my-var: #{$myVar};
