skip to Main Content

Sass variable concatenation in loops in Shopify

My SCSS compiles fine on sassmeister 1: $black: "black_rgb(0,0,0)"; $honey-brown: "honey-brown_rgb(144,122,106)"; $red: "red_rgb(255,0,0)"; $paints: $black, $honey-brown, $red; @each $color in $paints { $colSplit: str-index($color, _); $colName: str-slice($color, 1, $colSplit - 1); $colVal: str-slice($color, $colSplit + 1); .paint-#{$colName}-paint {background-color: #{$colVal};} }…

VIEW QUESTION
Back To Top
Search