Skip to content

Instantly share code, notes, and snippets.

@munkacsitomi
Created February 19, 2020 14:29
Show Gist options
  • Save munkacsitomi/dda2a164d4f66cca4b732b7febec4e66 to your computer and use it in GitHub Desktop.
Save munkacsitomi/dda2a164d4f66cca4b732b7febec4e66 to your computer and use it in GitHub Desktop.
Flexbox toolkit
@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