/name-badge.css Secret
Created
January 17, 2017 17:55
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
/* Default variant */ | |
.name-badge {} | |
.name-badge__name {} | |
.name-badge__avatar {} | |
.name-badge__description {} | |
/* Small variant */ | |
.name-badge--small {} | |
.name-badge--small .name-badge__name {} | |
.name-badge--small .name-badge__avatar {} | |
.name-badge--small .name-badge__description {} |
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
<!-- Default variant --> | |
<div clas="name-badge"> | |
<div class="name-badge__name"></div> | |
<img class="name-badge__avatar"> | |
<div class="name-badge__description"></div> | |
</div> | |
<!-- Small variant --> | |
<div clas="name-badge name-badge--small"> | |
<div class="name-badge__name"></div> | |
<img class="name-badge__avatar"> | |
<div class="name-badge__description"></div> | |
</div> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
When using a modifier for the parent element only, and using the selector as shown above, the only thing you have to change is the class name for the parent element, and not changing class names for all elements inside of the parent. Not necessarily everything would have to be overwritten by the modifier (for instance, the
font-size
of the description wouldn’t change, or description would be even hidden in the "small" version).