Skip to content

Instantly share code, notes, and snippets.

@czajkovsky
Last active August 29, 2015 14:04
Show Gist options
  • Save czajkovsky/ab032b1523b2adeacaf5 to your computer and use it in GitHub Desktop.
Save czajkovsky/ab032b1523b2adeacaf5 to your computer and use it in GitHub Desktop.
@mixin position($position, $args) {
position: $position;
@each $dir in top, right, bottom, left {
#{$dir}: map-get($args, $dir);
}
}
@mixin absolute($args) {
@include position(absolute, $args);
}
@mixin relative($args) {
@include position(relative, $args);
}
@mixin fixed($args) {
@include position(fixed, $args);
}
.positioned-with-maps {
@include absolute((top: 2rem, right: 2rem));
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment