Update _mixins.scss
This commit is contained in:
parent
a266914c3c
commit
967014e0ba
1 changed files with 23 additions and 0 deletions
|
@ -58,3 +58,26 @@
|
|||
clear: both;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Positioning
|
||||
*/
|
||||
|
||||
@mixin center($horizontal: true, $vertical: true) {
|
||||
position: absolute;
|
||||
@if ($horizontal and $vertical) {
|
||||
top: 50%;
|
||||
left: 50%;
|
||||
transform: translate(-50%, -50%);
|
||||
}
|
||||
@else if ($horizontal) {
|
||||
left: 50%;
|
||||
transform: translate(-50%, 0);
|
||||
}
|
||||
@else if ($vertical) {
|
||||
top: 50%;
|
||||
transform: translate(0, -50%);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue