Skip to content

Instantly share code, notes, and snippets.

@prod3v3loper
Last active February 23, 2019 14:50
Show Gist options
  • Save prod3v3loper/5eaa295c2d3cff7e149875e079dbd51c to your computer and use it in GitHub Desktop.
Save prod3v3loper/5eaa295c2d3cff7e149875e079dbd51c to your computer and use it in GitHub Desktop.
LESS CSS Parent Selector
.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