Created
November 8, 2016 07:44
-
-
Save wadackel/25bbd00648dd8cdca7ded242a376fc02 to your computer and use it in GitHub Desktop.
Mixin for positioning API.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| @mixin position($type, $top: null, $right: null, $bottom: null, $left: null, $z-index: null) { | |
| position: $type; | |
| top: $top; | |
| right: $right; | |
| bottom: $bottom; | |
| left: $left; | |
| z-index: $z-index; | |
| } | |
| @mixin fixed($args...) { | |
| @include position(fixed, $args...); | |
| } | |
| @mixin absolute($args...) { | |
| @include position(absolute, $args...); | |
| } | |
| @mixin relative($args...) { | |
| @include position(relative, $args...); | |
| } | |
| @mixin static() { | |
| @include position(static, null, null, null, null, null); | |
| } | |
| //== Usage | |
| .hoge { | |
| @include absolute(null, null, 50px, 10px, 100); | |
| } | |
| // .hoge { | |
| // position: absolute; | |
| // bottom: 50px; | |
| // left: 10px; | |
| // z-index: 100; | |
| // } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment