Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @mixin flexible ($vertically: center, $horizontally: center, $direction: row) {
- display: -webkit-box;
- display: -webkit-flex;
- display: -moz-flex;
- display: -ms-flexbox;
- display: flex;
- /* vertical align */
- @if $vertically == "center" {
- align-items: center;
- -webkit-align-align-items: center;
- -moz-align-items: center;
- } @else if $vertically == "bottom" {
- align-items: flex-end;
- -webkit-align-align-items: center;
- -moz-align-items: center;
- } @else if $vertically == "top" {
- align-items: flex-start;
- -webkit-align-align-items: center;
- -moz-align-items: center;
- } @else {
- align-items: $vertically;
- -webkit-align-items: $vertically;
- -moz-align-items: $vertically;
- }
- /* horizontal align */
- @if $horizontally == "center" {
- justify-content: center;
- -webkit-justify-content: center;
- -moz-justify-content: center;
- } @else if $horizontally == "right" {
- justify-content: flex-end;
- -webkit-justify-content: flex-end;
- -moz-justify-content: flex-end;
- } @else if $horizontally == "left" {
- justify-content: flex-start;
- -webkit-justify-content: flex-start;
- -moz-justify-content: flex-start;
- } @else {
- justify-content: $horizontally;
- -webkit-justify-content: $horizontally;
- -moz-justify-content: $horizontally;
- }
- @if $direction == "column" {
- -webkit-flex-direction: $direction;
- -moz-flex-direction: $direction;
- -ms-flex-direction:$direction;
- flex-direction: $direction;
- } @else if $direction "row" {
- -webkit-flex-direction: row;
- -moz-flex-direction: row;
- -ms-flex-direction: row;
- flex-direction: row;
- } @else {
- -webkit-flex-direction: $direction;
- -moz-flex-direction: $direction;
- -ms-flex-direction: $direction;
- flex-direction: $direction;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement