Last active
May 18, 2019 11:04
-
-
Save dieguezz/ca0024ddc3fbf8187523967ca9cca506 to your computer and use it in GitHub Desktop.
Basic css flex layout
This file contains 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
/* Flex styles */ | |
/* ie: .align-start-center => display: flex; align-items: flex-start; justify-content: center; */ | |
.flex, | |
.flex-1, | |
.column, | |
.row, | |
div[class^='align'] { | |
display: flex; | |
} | |
div[class^='align-start'] { | |
align-items: flex-start; | |
} | |
div[class^='align-end'] { | |
align-items: flex-end; | |
} | |
div[class^='align-center'] { | |
align-items: center; | |
} | |
div[class$='-start'] { | |
justify-content: flex-start; | |
} | |
div[class$='-end'] { | |
justify-content: flex-end; | |
} | |
div[class$='-between'] { | |
justify-content: space-between; | |
} | |
div[class$='-around'] { | |
justify-content: space-around; | |
} | |
div[class$='-even'] { | |
justify-content: space-evenly; | |
} | |
div[class$='-center'] { | |
justify-content: center; | |
} | |
.flex-1 { | |
flex: 1; | |
} | |
.column { | |
flex-direction: column; | |
} | |
.row { | |
flex-direction: row; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment