Skip to content

Instantly share code, notes, and snippets.

@webinista
Last active February 23, 2017 13:57
Show Gist options
  • Save webinista/51077aa0883250d82857 to your computer and use it in GitHub Desktop.
Save webinista/51077aa0883250d82857 to your computer and use it in GitHub Desktop.
A Sass mixin for using Flexbox
// See current support chart http://caniuse.com/#search=flexbox
/*
Flexbox mixins
Public Domain.
Latest syntax only.
*/
@mixin display-flex {
display: -webkit-flex;
display: flex;
}
@mixin flex-wrap($value) {
-webkit-flex-wrap: $value;
flex-wrap: $value;
}
@mixin flex-grow($value) {
-webkit-flex-grow: $value;
flex-grow: $value;
}
@mixin flex-shrink($value) {
-webkit-flex-shrink: $value;
flex-shrink: $value;
}
@mixin flex-basis($value) {
-webkit-flex-basis: $value;
flex-basis: $value;
}
@mixin flex($value) {
-webkit-flex: $value;
flex: $value;
}
@mixin justify-content($value) {
-webkit-justify-content: $value;
justify-content: $value;
}
@mixin align-items($value) {
-webkit-align-content: $value;
align-content: $value;
}
@1886
Copy link

1886 commented Feb 23, 2017

Thanks for this. One thing, should:

@mixin align-items($value) {
	-webkit-align-content: $value;
	align-content: $value;
}

not be

@mixin align-items($value) {
	-webkit-align-items: $value;
	align-items: $value;
}

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