I know that you can do simple math in Sass / Scss. But is there a way to subtract pixels from percentages? For instance:
$image-size: 200px; .bio { width: 100% - $image-size; }
I don’t see how this will work, the fact of SASS cannot magically find out the size of your box.
Now, if I get what you are trying to do, the best solution would be to wrap the width of the parent .box cell in a variable and then subtract the width of your image by this variable - given that 100% width means that it will get 100% specific width.
calc(), , . , .
Sass calc mixin, -webkit -moz ( Opera):
calc mixin
-webkit
-moz
@mixin calc($key, $value) { #{$key}: -webkit-calc(#{$value}); #{$key}: -moz-calc(#{$value}); #{$key}: calc(#{$value}); }
- :
.bio { @include calc("width", "100% - #{$image-size}"); }