-
-
Save webdevid/7d28d941e20842649a41cb27c043983f to your computer and use it in GitHub Desktop.
Sass BEM Mixins
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
@mixin element($name) { | |
@at-root #{&}__#{$name}{ | |
@content; | |
} | |
} | |
@mixin modifier($name) { | |
@at-root #{&}--#{$name} { | |
@content; | |
} | |
} | |
@mixin modified-by($arg) { | |
.#{$arg} & { | |
@content; | |
} | |
} |
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
.navbar { | |
padding-top: 1.875rem; | |
} | |
.navbar__list { | |
display: block; | |
} | |
.navbar--center .navbar__list { | |
display: inline-block; | |
} | |
.navbar__item { | |
float: left; | |
} | |
.navbar__link { | |
display: block; | |
padding: 1.25rem; | |
font-size: 1rem; | |
font-weight: bold; | |
text-transform: uppercase; | |
} | |
.navbar__link--active { | |
background-color: crimson; | |
color: white; | |
} | |
.navbar--center { | |
text-align: center; | |
} |
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
@import 'bem-builder'; | |
@import 'navbar'; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment