Thanks for this. I added something to include a default, for those unsupported like Opera, also:
@mixin calc($property, $default, $expression) { #{$property}: $default; #{$property}: -webkit-calc(#{$expression}); #{$property}: -moz-calc(#{$expression}); #{$property}: calc(#{$expression}); }
And a little extra info - in order o have the expression include a $var, I did this: @include calc(width, 98%, "100% - #{$border-width*2}");
Thanks for this. I added something to include a default, for those unsupported like Opera, also:
@mixin calc($property, $default, $expression) {
#{$property}: $default;
#{$property}: -webkit-calc(#{$expression});
#{$property}: -moz-calc(#{$expression});
#{$property}: calc(#{$expression});
}
And a little extra info - in order o have the expression include a $var, I did this:
@include calc(width, 98%, "100% - #{$border-width*2}");