Skip to content

Commit 91a8f4a

Browse files
authored
length-zero-no-unit: allow mixin/function argument default values with unit (#221)
1 parent 36db948 commit 91a8f4a

File tree

2 files changed

+23
-0
lines changed

2 files changed

+23
-0
lines changed

__tests__/valid.scss

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -170,3 +170,19 @@ $ratios:
170170
4 3,
171171
3 2,
172172
16 9;
173+
174+
@mixin hardcode-total-height($base-height, $extra-height: 0px) {
175+
height: calc($base-height + $extra-height);
176+
}
177+
178+
a {
179+
@include hardcode-total-height(10px);
180+
}
181+
182+
@function add-numbers($number-a, $number-b: 0px) {
183+
@return calc($number-a + $number-b)
184+
}
185+
186+
div {
187+
width: add-numbers(10px);
188+
}

index.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,13 @@ module.exports = {
1212
},
1313
],
1414
'import-notation': 'string',
15+
'length-zero-no-unit': [
16+
true,
17+
{
18+
ignore: ['custom-properties'],
19+
ignorePreludeOfAtRules: ['function', 'mixin'],
20+
},
21+
],
1522
'scss/at-else-closing-brace-newline-after': 'always-last-in-chain',
1623
'scss/at-else-closing-brace-space-after': 'always-intermediate',
1724
'scss/at-else-empty-line-before': 'never',

0 commit comments

Comments
 (0)