Created
February 19, 2020 14:29
-
-
Save munkacsitomi/dda2a164d4f66cca4b732b7febec4e66 to your computer and use it in GitHub Desktop.
Flexbox toolkit
This file contains hidden or 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
@mixin flex-column { | |
display: flex; | |
flex-direction: column; | |
} | |
@mixin flex-center { | |
display: flex; | |
align-items: center; | |
justify-content: center; | |
} | |
@mixin flex-center-column { | |
@include flex-center; | |
flex-direction: column; | |
} | |
@mixin flex-center-vert { | |
display: flex; | |
align-items: center; | |
} | |
@mixin flex-center-horiz { | |
display: flex; | |
justify-content: center; | |
} | |
// how to use: | |
.vertical-centered-element { | |
@include flex-center-vert; | |
} | |
.horizontally-centered-element { | |
flex-direction: column; | |
@include flex-center-vert; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment