Skip to content

Commit 9db1109

Browse files
authored
Stylelint: Do not enforce unitless zero value in custom properties (#44401)
* Fix unitless overcorrection * Add changelogs
1 parent 584544e commit 9db1109

File tree

6 files changed

+24
-3
lines changed

6 files changed

+24
-3
lines changed
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
Significance: patch
2+
Type: fixed
3+
4+
Fix padding on input and textarea fields.

projects/packages/forms/src/contact-form/css/grunion.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
--jetpack--contact-form--border-color: #8c8f94;
44
--jetpack--contact-form--border-size: 1px;
55
--jetpack--contact-form--border-style: solid;
6-
--jetpack--contact-form--border-radius: 0;
6+
--jetpack--contact-form--border-radius: 0px;
77
--jetpack--contact-form--input-padding: 16px;
88
--jetpack--contact-form--font-size: 16px;
99
--jetpack--contact-form--error-color: #b32d2e;

projects/plugins/boost/app/assets/src/js/pages/image-size-analysis/image-size-analysis.module.scss

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,8 @@
3636
* Narrow screen overrides.
3737
*/
3838
@media ( max-width: 782px ) {
39-
--expanded-gap: 0;
40-
--border-radius: 0;
39+
--expanded-gap: 0px;
40+
--border-radius: 0px;
4141
--table-column-expand: 32px;
4242
}
4343
}
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
Significance: patch
2+
Type: fixed
3+
Comment: Use units in CSS vars to avoid issues with CSS math functions.
4+
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
Significance: patch
2+
Type: bugfix
3+
4+
Forms: Fix padding on input and textarea fields.

tools/js-tools/stylelint.config.base.mjs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,15 @@ const baseConfig = {
1919
},
2020
],
2121

22+
// Stylelint allows `0px` in math-type functions, but sometimes those math-type functions are
23+
// passed vars instead of hard-coded values, and we need to prevent those from being unitless.
24+
'length-zero-no-unit': [
25+
true,
26+
{
27+
ignore: [ 'custom-properties' ],
28+
},
29+
],
30+
2231
// In theory this is a good rule, but in practice it's a massive lift to resolve existing violations.
2332
// Here's an example that has no good answers:
2433
// https://github.com/Automattic/jetpack/blob/86e27497d4b8e0736cae61c325f017dedad16dbb/projects/js-packages/components/components/button/style.module.scss#L73-L94

0 commit comments

Comments
 (0)