Skip to content

Instantly share code, notes, and snippets.

@neutraltone
Created September 2, 2022 22:49
Show Gist options
  • Save neutraltone/25922a4c7ea989e6d7e0315a851c10ae to your computer and use it in GitHub Desktop.
Save neutraltone/25922a4c7ea989e6d7e0315a851c10ae to your computer and use it in GitHub Desktop.
Generated by SassMeister.com.
$color: white;
$colors: red, blue, green, yellow, tomato;
.group {
.child {
background-color: $color;
}
@each $color in $colors {
.group--#{$color} .child {
background-color: $color;
}
}
}
.group .child {
background-color: white;
}
.group .group--red .child {
background-color: red;
}
.group .group--blue .child {
background-color: blue;
}
.group .group--green .child {
background-color: green;
}
.group .group--yellow .child {
background-color: yellow;
}
.group .group--tomato .child {
background-color: tomato;
}
{
"sass": {
"compiler": "dart-sass/1.32.12",
"extensions": {},
"syntax": "SCSS",
"outputStyle": "expanded"
},
"autoprefixer": false
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment