Created
February 17, 2013 20:41
-
-
Save mirisuzanne/4973348 to your computer and use it in GitHub Desktop.
Bleed Mixin
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 bleed( | |
$width: $grid-padding, | |
$sides: left right, | |
$style: $container-style | |
) { | |
@if $border-box-sizing { @include box-sizing(content-box) } | |
@if type-of($width) == 'list' { | |
$width: filter($width, of); | |
$width: space(nth($width,1), nth($width,2), $style); | |
} @else if unitless($width) { | |
$width: space($width, $style: $style); | |
} | |
@if $sides == 'all' { | |
margin: - $width; | |
padding: $width; | |
} @else { | |
@each $side in $sides { | |
margin-#{$side}: - $width; | |
padding-#{$side}: $width; | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This is just exactly what I've been looking for, thank you :)