I'm trying to create a mixin that will take an ID and declare a bunch of variables with that ID prefix at the start of the variable names.
Something like this -
@mixin declareVars($id) {
$#{$id}-background-color: null !default;
$#{$id}-background-image: null !default;
$#{$id}-background-size: null !default;
$#{$id}-background-position-x: null !default;
$#{$id}-background-position-y: null !default;
$#{$id}-background-repeat: null !default;
$#{$id}-color: null !default;
$#{$id}-border-radius: null !default;
$#{$id}-border-width: null !default;
$#{$id}-border-color: null !default;
$#{$id}-padding: null !default;
$#{$id}-margin: null !default;
}
The above throws a syntax error.
Is this functionality achievable in SCSS?
Variable interpolation does not work at all.
But you can use CSS variables:
Output of SCSS block: