Last active
April 9, 2019 13:14
-
-
Save vanderb/f8bc4ecd13d6ba72271fd05f7239e47a to your computer and use it in GitHub Desktop.
Responsive Spacer-Mixin for foundation 6
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
$spaceamounts: (0, 5, 10, 15, 20, 30, 40, 50); // Adjust this to include the pixel amounts you need. | |
$sides: (top, bottom); | |
$space-attr: ("margin", "padding"); // margin or padding | |
@each $breakpoint in $breakpoint-classes { | |
@if $breakpoint == 'small' { | |
@each $space in $spaceamounts { | |
@each $side in $sides { | |
@each $attr in $space-attr { | |
.#{str-slice($attr, 0, 1)}#{str-slice($side, 0, 1)}-#{$space} { | |
#{$attr}-#{$side}: rem-calc($space) !important; | |
} | |
} | |
} | |
} | |
} @else { | |
@include breakpoint($breakpoint) { | |
@each $space in $spaceamounts { | |
@each $side in $sides { | |
@each $attr in $space-attr { | |
.#{$breakpoint}-#{str-slice($attr, 0, 1)}#{str-slice($side, 0, 1)}-#{$space} { | |
#{$attr}-#{$side}: rem-calc($space) !important; | |
} | |
} | |
} | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment