Skip to content

Instantly share code, notes, and snippets.

@dalemanthei
Created May 3, 2015 16:19
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 dalemanthei/38d30dedc27388ac5f61 to your computer and use it in GitHub Desktop.
Save dalemanthei/38d30dedc27388ac5f61 to your computer and use it in GitHub Desktop.
Simple CSS styles to keep separate layout from other CSS concerns. The fc-* class establishes the container, its direct descendents should apply one of the fi-* styles.
/* Vertical (column) Flex Container for actions
-------------------------------------------------- */
.fc-col {
display: flex;
flex-direction: column;
flex-wrap: nowrap;
justify-content: flex-start;
align-content: stretch;
align-items: stretch;
}
/* Horizontal (row) Flex Container
-------------------------------------------------- */
.fc-row {
display: flex;
flex-direction: row;
flex-wrap: nowrap;
justify-content: flex-start;
align-content: stretch;
align-items: flex-start;
}
/* Flex Items
-------------------------------------------------- */
// header and footer intended for column use, elements applying
// this style should also apply a style with a height
.fi-header, .fi-footer {
order: 0;
flex: 0 0 auto;
align-self: auto;
}
// body is intended to be used in both horizontal and vertical flex
// containers and will consume the space not reserved by header,
// footer, or button styles.
.fi-body {
order: 0;
flex: 1 1 auto;
align-self: auto;
}
// btn is intended for use in a row or horizontal container. Elements
// applying this style should also apply a style with a width
.fi-btn {
order: 0;
flex: 0 0 auto;
align-self: auto;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment