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
.widget { | |
$b: &; | |
&__heading { | |
color: navyblue; | |
} | |
// bad – does not evaluate to what we want | |
&--halloween { | |
&__heading { |
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
/* | |
<div class="layer bgWhite">…</div> | |
<div class="layer bgGold">…</div> | |
<div class="layer bgWhite">…</div> | |
<div class="layer bgWhite">…</div> | |
<div class="layer bgGold">…</div> | |
*/ |
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
.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; |
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
.dan { | |
&__body { | |
background-color: gold; | |
} | |
// I want to target .dan__body when it is a child of the --dark modifier | |
&--dark { | |
&__body { | |
background-color: lightgray; |
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
.dan { | |
&__body { | |
background-color: gold; | |
} | |
// I want to target .dan__body when it is a child of the --dark modifier | |
&--dark { | |
&__body { | |
background-color: lightgray; |
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
.dan { | |
&__body { | |
background-color: gold; | |
} | |
&--dark { | |
&__body { | |
background-color: lightgray; | |
} | |
} |
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
@function tint-color($color, $weight) { | |
@return mix(white, $color, $weight); | |
} | |
@function shade-color($color, $weight) { | |
@return mix(black, $color, $weight); | |
} | |
@function shift-color($color, $weight) { |
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
.typicalWay { | |
&__heading { | |
color: red; | |
} | |
&.-halloween { | |
.typicalWay__heading { | |
color: orange; | |
} | |
} |
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
.typicalWay { | |
&__heading { | |
color: red; | |
} | |
&.-halloween { | |
.typicalWay__heading { | |
color: orange; | |
} | |
} |