Skip to content

Instantly share code, notes, and snippets.

@ryanve
Last active April 3, 2017 04:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ryanve/1edcbc4aa16a50a367ae36d3d795510b to your computer and use it in GitHub Desktop.
Save ryanve/1edcbc4aa16a50a367ae36d3d795510b to your computer and use it in GitHub Desktop.
space mixin
$space: .5rem !default;
$space-aliases: () !default;
// Compute spacing value
// space(1) => $space
// space(2, 1rem) => 2rem
@function space($multiple: 1, $space: $space) {
@if map-has-key($space-aliases, $multiple) {
$multiple: map-get($space-aliases, $multiple);
}
@return $multiple * $space;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment