Created
July 2, 2015 17:28
-
-
Save elussich/6410506b7a230b8a7980 to your computer and use it in GitHub Desktop.
Generated by SassMeister.com.
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
| // ---- | |
| // Sass (v3.3.14) | |
| // Compass (v1.0.3) | |
| // ---- | |
| @mixin extend-component($block, $elementModifier: '') { | |
| @extend #{$block}; | |
| &#{$elementModifier} { | |
| @extend #{$block + $elementModifier}; | |
| } | |
| } | |
| .block { | |
| background-color: blue; | |
| &__element { | |
| height: 20px; | |
| } | |
| &__element--modifier { | |
| color: red; | |
| } | |
| } | |
| .my-component { | |
| @include extend-component('.block'); | |
| @include extend-component('.block', '__element'); | |
| @include extend-component('.block', '__element--modifier'); | |
| } |
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, .my-component { | |
| background-color: blue; | |
| } | |
| .block__element, .my-component__element { | |
| height: 20px; | |
| } | |
| .block__element--modifier, .my-component__element--modifier { | |
| color: red; | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment