0

I have an existing SASS map that looks like this:

@each $color, $value in $theme-colors {
  .old-name-#{$color} {
      color: $value;
  }
}

I want to keep .old-name in my CSS but create a new alias with new naming. For other areas I'm just using:

.new-name { 
  @extend .old-name;
}

How does it work in the syntax when you want to extend a class with a map? Is something like this possible?

.new-name-#($color) { 
  @extend .old-name-#($color);
}
daggett
  • 239
  • 2
  • 4
  • 15

1 Answers1

0

Yes, it is perfectly possible to extends the selectors you created using maps.

@each $color, $value in $theme-colors {
  .old-name-#{$color} {
    color: $value;
  }
}

@each $color, $value in $theme-colors {
  .new-name-#{$color} {
    @extend .old-name-#{$color};
  }
}
EdenF
  • 128
  • 6