Last active
December 11, 2015 00:07
-
-
Save tncbbthositg/e73e7cf276b1926923a8 to your computer and use it in GitHub Desktop.
Creating media specific alignments in SCSS
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 media-specific-styles($class) { | |
%#{$class} { @content; } | |
@each $size, $dim in $mq-sizes { | |
@include breakpoint($size) { | |
%#{$class}--#{$size} { @content; } | |
.#{$class}--#{$size} { @extend %#{$class}--#{$size}; } | |
} | |
} | |
} | |
@include media-specific-styles('align--right') { | |
text-align: right; | |
} | |
.test-class { | |
@extend %align--right--md; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment