-
-
Save kayandra/9b233e241e3bf03f482e69d42255a917 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