Skip to content

Instantly share code, notes, and snippets.

@dieguezz
Last active May 18, 2019 11:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dieguezz/ca0024ddc3fbf8187523967ca9cca506 to your computer and use it in GitHub Desktop.
Save dieguezz/ca0024ddc3fbf8187523967ca9cca506 to your computer and use it in GitHub Desktop.
Basic css flex layout
/* 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