How to use variable in another variable in SCSS

Viewed 404

How I can use a variable in another variable? How I can do this:

$buttons: default, success, primary, info, warning, danger;

$default_color: #aaa;
$success_color: #bbb;
$primary_color: #ccc;
$info_color: #ddd;
$warning_color: #eee;
$danger_color: #fff;


@each $b in $buttons {
  .btn-#{$b} {
    color: $#{b}_color;
  }
}
2 Answers
Related