Forked from starryeyez024/Shorthand-Sass-Extend.css
Created
December 12, 2013 23:24
-
-
Save blackfalcon/7937413 to your computer and use it in GitHub Desktop.
Shorthand Sass Extend
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
.foo, .bar { | |
background: red; | |
} |
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
// ---- | |
// Sass (v3.3.0.rc.1) | |
// Compass (v0.13.alpha.10) | |
// ---- | |
// add this mixin to your Sass file: | |
@mixin ext($name, $silent: false) | |
@if $silent == true | |
@extend %#{$name} !optional | |
@else | |
@extend .#{$name} !optional | |
// then you may extend other classes in a shorter format: | |
%foo | |
background: red | |
.bar | |
+ext(foo, true) | |
//instead of: | |
//@extend .foo !optional | |
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
.bar { | |
background: red; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment