Last active
November 21, 2016 12:48
-
-
Save orlovmax/7dcb059b85c04c176a2a to your computer and use it in GitHub Desktop.
Less/Scss trick to generate BEM-styled selectors
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
Less css trick to generate BEM-styled selectors, by Max Shirsin, http://noteskeeper.ru/1139 + Scss version | |
@block: ~".dm-import-feed"; | |
@{block} { | |
&_step_2 { | |
@{block}__page_step_2 { | |
display: block; | |
} | |
} | |
} |
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
Scss variant of this hack | |
$block: #{".dm-import-feed"}; | |
#{$block} { | |
&_step_2 { | |
#{$block}__page_step_2 { | |
display: block; | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment