Skip to content

Instantly share code, notes, and snippets.

@maxviewup
Last active July 26, 2017 12:04
Show Gist options
  • Save maxviewup/70c73e474a2e6172fa3dbd79457bb595 to your computer and use it in GitHub Desktop.
Save maxviewup/70c73e474a2e6172fa3dbd79457bb595 to your computer and use it in GitHub Desktop.
SASS/SCSS #at-root and #selector-unify examples
// ----
// Sass (v3.4.21)
// Compass (v1.0.3)
// ----
// Class component
.component{
color:red;
@at-root section#{&} {
color:blue;
}
.child{
color: blue;
@at-root #{selector-unify(&, p)}{
color: red;
}
}
}
.component {
color: red;
}
section.component {
color: blue;
}
.component .child {
color: blue;
}
.component p.child {
color: red;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment