I want to ask how I can auto-generate css variable by sass function
for example: I want this variable to auto-generate
:root{--sample1:red;}
SASS function:
@function brand($key,$val) {
//this not works
:root{
--#{$key}:$val;
}
@return val(--#{$val});}
use the brand function
header{
background-color:brand("sample1",red)
}
var(--#{$val})is wrong as it should be#{$key}