Skip to content

Instantly share code, notes, and snippets.

@VinSpee
Last active December 11, 2015 16:09
Show Gist options
  • Save VinSpee/4625913 to your computer and use it in GitHub Desktop.
Save VinSpee/4625913 to your computer and use it in GitHub Desktop.
fill a gutter with padding from your el instead of margin.
// requires that you're using the susy grid system (you should be anyway.)
=span-columns-and-fill-gutter($cols, $context: false)
@if ($context != false)
width: space($cols, $context)
@else
width: space($cols)
margin-right: 0
padding-right: gutter()
// In use:
.my-el
+span-columns-and-fill-gutter(1)
// Or, with context:
.my-el
+span-columns-and-fill-gutter(1, 12)
@mirisuzanne
Copy link

Looks like you've mixed soft and hard tabs?

@mirisuzanne
Copy link

If you would rather keep the border-box model, you can add width: space($cols); You might also want to add an option for $context to be passed in so nested elements can use it. We may have to consider something like this in Susy Next. Care to file an issue?

@VinSpee
Copy link
Author

VinSpee commented Jan 27, 2013

@ericam I'm always fighting gist on tabs when I use the web interface.

I'll update this mixin and file the issue! Thanks for the feedback.

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