Last active
December 20, 2015 17:59
-
-
Save babsgosgens/6172522 to your computer and use it in GitHub Desktop.
Mixin column spacing. Uses padding by default, but can be overridden to use margins instead - helpful when assigning backgrounds or borders.
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
@mixin column-spacing($fraction: 1/2, $use-margin: false, $persistent: false) | |
{ | |
@if ($use-margin) { | |
margin-left: horizontal-rhythm($fraction); | |
margin-right: horizontal-rhythm($fraction); | |
@if $persistent == false { | |
@if $column-breakpoint { | |
@include breakpoint( $column-breakpoint ) { | |
margin-left: horizontal-rhythm($fraction/2); | |
margin-right: horizontal-rhythm($fraction/2); | |
} | |
} | |
} | |
} | |
@else { | |
padding-left: horizontal-rhythm($fraction); | |
padding-right: horizontal-rhythm($fraction); | |
@if $persistent == false { | |
@if $column-breakpoint { | |
@include breakpoint( $column-breakpoint ) { | |
padding-left: horizontal-rhythm($fraction/2); | |
padding-right: horizontal-rhythm($fraction/2); | |
} | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment