Skip to content

Instantly share code, notes, and snippets.

@mirisuzanne
Created February 17, 2013 20:41
Show Gist options
  • Save mirisuzanne/4973348 to your computer and use it in GitHub Desktop.
Save mirisuzanne/4973348 to your computer and use it in GitHub Desktop.
Bleed Mixin
@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;
}
}
}
@LimeBlast
Copy link

This is just exactly what I've been looking for, thank you :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment