Last active
July 26, 2017 12:04
-
-
Save maxviewup/70c73e474a2e6172fa3dbd79457bb595 to your computer and use it in GitHub Desktop.
SASS/SCSS #at-root and #selector-unify examples
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ---- | |
// 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; | |
} | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.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