Adding default value to a mixin argument

When compiled into .css .container will get: -webkit-box-sizing: content-box; -moz-box-sizing: content-box; box-sizing: content-box; and .content will get : -webkit-box-sizing: border-box; -moz-box-sizing: border-box; box-sizing: border-box;

@mixin box-sizing($x: border-box) {
	-webkit-box-sizing: $x;
  	-moz-box-sizing: $x;
  	box-sizing: $x;
}
.container {
    @inlcude box-sizing(content-box); 
}
.content {
	@include box-sizing; //will get the value of border-box by default
}

Add your comment