public
Created

Flexbox SASS mixin (Compass required) Implementation based on Chris Coyier's article: Using Flexbox: Mixing Old and New for the Best Browser Support (http://css-tricks.com/using-flexbox/)

  • Download Gist
flexbox-mixin.scss
SCSS
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28
// ==================================================================
// Flexbox
//
// Implementation based on Chris Coyier's article:
// Using Flexbox: Mixing Old and New for the Best Browser Support || http://css-tricks.com/using-flexbox/
// ==================================================================
 
// Flexbox Context (applied to container element of flex items)
@mixin flex-display {
@include experimental-value(display, box, -moz, -webkit, not -o, -ms, not -khtml, official); // Old
@include experimental-value(display, flex, -moz, -webkit, not -o, -ms, not -khtml, official);
}
 
// Controlling widths
@mixin flex($flex, $flex-width: false) {
@include experimental(box-flex, $flex, -moz, -webkit, not -o, not -ms, not -khtml, not official);
@if $flex-width {
width: $flex-width;
}
@include experimental(flex, $flex, not -moz, -webkit, not -o, -ms, not -khtml, official);
}
 
// Re-Ordering
@mixin flex-order($order) {
@include experimental(box-ordinal-group, $order, -moz, -webkit, not -o, not -ms, not -khtml, not official);
@include experimental(flex-order, $order, not -moz, not -webkit, not -o, -ms, not -khtml, not official);
@include experimental(order, $order, not -moz, -webkit, not -o, not -ms, not -khtml, not official);
}

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.