What I do is this:
on helpers.scss
@use 'variables' as vars;
on _variables.scss
$black: #000;
$white: #fff;
$colors: (
'black': $black,
'white': $white,
);
:root {
@each $name, $color in $colors {
--#{$name}: #{$color};
}
}
and I get on main.css
:root {
--black: #000;
--white: #fff;
}