Skip to content

Latest commit

 

History

History
64 lines (50 loc) · 1.09 KB

File metadata and controls

64 lines (50 loc) · 1.09 KB

function-no-interpolation

Since the release of first-class calc(), calculation functions calc(), clamp(), min(), and max() accept variables and function calls as arguments.

This rule forbids interpolation in calc(), clamp(), min(), and max() functions to avoid extra verbose or even invalid CSS.

.a { .b: calc(#{$c} + 1); }
/**            ↑
      * This argument */

Options

true

The following patterns are considered warnings:

$c: 1;
.a { .b: calc(#{$c + 1}); }
$c: 1;
.a { .b: calc(max(#{$c})); }
$c: 1;
.a { .b: min(#{$c}); }
$c: 1;
.a { .b: clamp(#{$c} + 2px); }

The following patterns are not considered warnings:

.a { .b: calc(1 + 1); }
$c: 1;
.a { .b: abc(#{$c} + 1px); }
$c: 1;
.a { .b: calc(abc(#{$c})); }