-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
50 additions
and
15 deletions.
There are no files selected for viewing
This file contains 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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,34 @@ | ||
@function _translate_amount($start, $stop) { | ||
@function _translate_amount($stop) { | ||
@if $stop == null { | ||
@return -50%; | ||
} @else { | ||
@return 50%; | ||
} | ||
} | ||
|
||
|
||
@function _sanitise_start($start, $stop) { | ||
@if $start == null { | ||
@if $stop == null { | ||
@return 0; | ||
} @else { | ||
@return 50%; | ||
} @else { | ||
@return null; | ||
} | ||
} @else { | ||
@if $stop == null { | ||
@return -50%; | ||
@return $start; | ||
} @else { | ||
@error "too many positioning args"; | ||
@error "clashing positioning args"; | ||
} | ||
} | ||
} | ||
|
||
|
||
@mixin absolute_position_centred($top: null, $right: null, $bottom: null, $left: null) { | ||
position: absolute; | ||
transform: translate(_translate_amount($left, $right), _translate_amount($top, $bottom)); | ||
top: $top; | ||
transform: translate(_translate_amount($right), _translate_amount($bottom)); | ||
top: _sanitise_start($top, $bottom); | ||
right: $right; | ||
bottom: $bottom; | ||
left: $left; | ||
left: _sanitise_start($left, $right); | ||
} |
This file contains 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