Sass string interpolation

ccsunny - Jul 20 '23 - - Dev Community
// Sass string interpolation syntax is #{VARIABLE} 
$block: ".MyComponent";

#{$block} {
  &-title {
    #{$block}--xmasTheme & {
    }
  }
}

// Compiles to
.MyComponent {}
.MyComponent-title {}
.MyComponent--xmasTheme .MyComponent-title {}
Enter fullscreen mode Exit fullscreen mode
. . . . . . . . . . . . . . . . . . . .