Skip to content

Instantly share code, notes, and snippets.

@marcelmoreau
Created September 13, 2021 21:39
Show Gist options
  • Save marcelmoreau/392a87a8f2a3b8dec2702ab2d62a9929 to your computer and use it in GitHub Desktop.
Save marcelmoreau/392a87a8f2a3b8dec2702ab2d62a9929 to your computer and use it in GitHub Desktop.
Generated by SassMeister.com.
.dan {
&__body {
background-color: gold;
}
// I want to target .dan__body when it is a child of the .dan--dark modifier
&--dark {
&__body {
background-color: lightgray;
}
}
}
.marcel {
$b: &;
&__body {
background-color: peru;
}
&--dark {
#{$b}__body {
background-color: aliceblue;
}
}
}
/* I just dislike doing this: */
.rachel {
&__body {
background-color: gold;
}
&--dark {
.rachel__body {
background-color: orange;
}
}
}
.dan__body {
background-color: gold;
}
.dan--dark__body {
background-color: lightgray;
}
.marcel__body {
background-color: peru;
}
.marcel--dark .marcel__body {
background-color: aliceblue;
}
/* I just dislike doing this: */
.rachel__body {
background-color: gold;
}
.rachel--dark .rachel__body {
background-color: orange;
}
{
"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