Skip to content

Instantly share code, notes, and snippets.

@dfdeagle47
Last active November 4, 2015 15:17
Show Gist options
  • Save dfdeagle47/52fb044e0f6a8574f89b to your computer and use it in GitHub Desktop.
Save dfdeagle47/52fb044e0f6a8574f89b to your computer and use it in GitHub Desktop.
Generated by SassMeister.com.
// ----
// libsass (v3.2.5)
// ----
//I have
.interactions {
body {
background: red;
}
}
//I need
body.interactions {
background: red;
}
//I don't want to explicit put .interactions {} in each file, so I did
// .interactions {
// @import ...
// }
// in the main.scss
.interactions {
//Bad because .interactions is at a higher level that body
body {
background: red;
}
//Bad because .interactions class should be on the same element
body & {
background: red;
}
//Bad because .interactions is also present at the higher level
body#{&} {
background: red;
}
//Bad because .interactions is still present at the higher level
@at-root body#{&} {
background: red;
}
//Works without variable interpolation... weird
@at-root body.interactions {
background: red;
}
}
.interactions body {
background: red;
}
body.interactions {
background: red;
}
.interactions body {
background: red;
}
body .interactions {
background: red;
}
.interactions body.interactions {
background: red;
}
.interactions body.interactions {
background: red;
}
body.interactions {
background: red;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment