Skip to content

Instantly share code, notes, and snippets.

@ReneKriest
Created September 30, 2014 12:52
Show Gist options
  • Save ReneKriest/0fe6698ea02fd90ac11f to your computer and use it in GitHub Desktop.
Save ReneKriest/0fe6698ea02fd90ac11f to your computer and use it in GitHub Desktop.
Generated by SassMeister.com.
<div class='flexContainer height'>
<div>Item</div>
</div>
// ----
// Sass (v3.3.14)
// Compass (v1.0.1)
// ----
@mixin flexContainer ($flex-direction: row, $flex-wrap: wrap, $align-items: center, $justify-content: center) {
display: -ms-flexbox;
display: -webkit-flex;
display: flex;
// row / column
-ms-flex-direction: $flex-direction;
-webkit-flex-direction: $flex-direction;
flex-direction: $flex-direction;
// wrap / no-wrap
-ms-flex-wrap: $flex-wrap;
-webkit-flex-wrap: $flex-wrap;
flex-wrap: $flex-wrap;
// align cross axis
-ms-flex-align: $align-items;
-webkit-align-items: $align-items;
align-items: $align-items;
// align axis
-ms-flex-pack: $justify-content;
-webkit-justify-content: $justify-content;
justify-content: $justify-content;
}
.flexContainer {
@include flexContainer(row, no-wrap, center, center)
}
.height {
height: 300px;
height: 90vh;
}
.flexContainer {
display: -ms-flexbox;
display: -webkit-flex;
display: flex;
-ms-flex-direction: row;
-webkit-flex-direction: row;
flex-direction: row;
-ms-flex-wrap: no-wrap;
-webkit-flex-wrap: no-wrap;
flex-wrap: no-wrap;
-ms-flex-align: center;
-webkit-align-items: center;
align-items: center;
-ms-flex-pack: center;
-webkit-justify-content: center;
justify-content: center;
}
.height {
height: 300px;
height: 90vh;
}
<div class='flexContainer height'>
<div>Item</div>
</div>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment