Skip to content

Instantly share code, notes, and snippets.

@stephen-james
Last active December 15, 2015 11:29
Show Gist options
  • Save stephen-james/5253090 to your computer and use it in GitHub Desktop.
Save stephen-james/5253090 to your computer and use it in GitHub Desktop.
Useful .LESS css mixins
.flex-box(@pack, @align, @orient)
{
display:-moz-box;
-moz-box-pack:@pack;
-moz-box-align:@align;
-moz-box-orient: @orient;
display:-webkit-box;
-webkit-box-pack:@pack;
-webkit-box-align:@align;
-webkit-box-orient:@orient;
display:box;
box-pack:@pack;
box-align:@align;
box-orient:@orient;
/* for IE support (pre-10) use shim from https://github.com/doctyper/flexie */
}
.box-sizing(@sizingModel)
{
-webkit-box-sizing: @sizingModel;
-moz-box-sizing: @sizingModel;
box-sizing: @sizingModel;
}
.background-gradient(@startColour, @endColour)
{
background: mix(@startColour, @endColour, 50%);
background-image: -webkit-gradient(linear,left top,left bottom,from( @startColour ),to( @endColour ));
background-image: -webkit-linear-gradient( @startColour,@endColour );
background-image: -moz-linear-gradient( @startColour,@endColour );
background-image: -ms-linear-gradient( @startColour,@endColour );
background-image: -o-linear-gradient( @startColour,@endColour );
background-image: linear-gradient( @startColour,@endColour );
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment