1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859 |
- @function calc-sum($one, $two) {
- @if $one != null and $two != null {
- @if $one == 0 {
- @return $two;
- }
- @if $two == 0 {
- @return $one;
- }
- // TODO if units are the same no need to use calc
- @return calc(#{$one} + #{$two});
- }
- @if $one != null {
- @return $one;
- }
- @if $two != null {
- @return $two;
- }
- @return null;
- }
- @function calc-diff($one, $two) {
- @if $one != null and $two != null {
- @if $one == 0 {
- @return $two;
- }
- @if $two == 0 {
- @return $one;
- }
- // TODO if units are the same no need to use calc
- @return calc(#{$one} - #{$two});
- }
- @if $one != null {
- @return $one;
- }
- @if $two != null {
- @return $two;
- }
- @return null;
- }
- @function add-if ($value1, $value2) {
- @if $value1 == null or $value2 == null {
- @return null;
- }
- @return $value1 + $value2;
- }
|