Skip to content

Instantly share code, notes, and snippets.

@fabien-d
Last active June 8, 2018 14:22
Show Gist options
  • Save fabien-d/5968375 to your computer and use it in GitHub Desktop.
Save fabien-d/5968375 to your computer and use it in GitHub Desktop.
SASS mixin for shorthand position value. Only outputs the value specified. Usage `@include position( TOP, RIGHT, BOTTOM, LEFT );`
@mixin position( $top: null, $right: null, $bottom: null, $left: null ) {
@if $top { top: $top; }
@if $right { right: $right; }
@if $bottom { bottom: $bottom; }
@if $left { left: $left; }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment