_position.scss 715 B

1234567891011121314151617181920212223242526272829303132
  1. @mixin position ($position: relative, $coordinates: null null null null) {
  2. @if type-of($position) == list {
  3. $coordinates: $position;
  4. $position: relative;
  5. }
  6. $coordinates: unpack($coordinates);
  7. $top: nth($coordinates, 1);
  8. $right: nth($coordinates, 2);
  9. $bottom: nth($coordinates, 3);
  10. $left: nth($coordinates, 4);
  11. position: $position;
  12. @if ($top and $top == auto) or (type-of($top) == number) {
  13. top: $top;
  14. }
  15. @if ($right and $right == auto) or (type-of($right) == number) {
  16. right: $right;
  17. }
  18. @if ($bottom and $bottom == auto) or (type-of($bottom) == number) {
  19. bottom: $bottom;
  20. }
  21. @if ($left and $left == auto) or (type-of($left) == number) {
  22. left: $left;
  23. }
  24. }