For CSS output see LESS Parent Selector
Last active
February 23, 2019 14:50
-
-
Save prod3v3loper/5eaa295c2d3cff7e149875e079dbd51c to your computer and use it in GitHub Desktop.
LESS CSS Parent Selector
This file contains hidden or 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
.block { | |
/* Hold parent selector */ | |
@this: block; | |
/* Element */ | |
&__elem { | |
width: 100%; | |
/* Element */ | |
.@{this}__something { | |
background-color: #fff; | |
} | |
/* Modifier */ | |
.@{this}--something { | |
background-color: #0ff; | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment