Skip to content

Instantly share code, notes, and snippets.

@steezeburger
Last active June 14, 2019 08:18
Show Gist options
  • Star 3 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save steezeburger/63d02783103f134b0e70 to your computer and use it in GitHub Desktop.
Save steezeburger/63d02783103f134b0e70 to your computer and use it in GitHub Desktop.
Flexbox Helper Classes written in SCSS
/*
* Custom Flexbox Helper Classes
*/
.flex {
display: flex;
&.cell {
flex: 1;
}
&.equal-sizing {
> * {
flex-basis: 0;
flex-grow: 1;
}
}
&.flex-column {
flex-direction: column;
&.top {
align-content: flex-start;
}
&.bottom {
align-content: flex-end;
}
&.vertical-center {
align-content: center;
}
&.space-between {
align-content: space-between;
}
&.space-around {
align-content: space-around;
}
} // end column
&.flex-row {
flex-direction: row;
&.wrap {
flex-flow: row wrap;
}
&.top {
align-items: flex-start;
}
&.bottom {
align-items: flex-end;
}
&.vertical-center {
align-items: center;
}
&.baseline {
align-items: baseline;
}
&.stretch {
align-items: stretch;
}
} // end row
// along main axis
&.start {
justify-content: flex-start;
}
&.end {
justify-content: flex-end;
}
&.center {
justify-content: center;
}
&.space-between {
justify-content: space-between;
}
&.space-around {
justify-content: space-around;
}
} // end flexbox helpers
Copy link

ghost commented Jun 14, 2019

Please add responsive options.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment