I\'m trying to use string interpolation on my variable to reference another variable:
// Set up variable and mixin
$
Sass does not allow variables to be created or accessed dynamically. However, you can use lists for similar behavior.
scss:
$list: 20px 30px 40px;
@mixin get-from-list($index) {
width: nth($list, $index);
}
$item-number: 2;
#smth {
@include get-from-list($item-number);
}
css generated:
#smth {
width: 30px;
}