liferay/liferay-frontend-projects

Add extra options to stylelint length-zero-no-unit to work well with custom variables

victorg1991 opened this issue · 0 comments

As suggested in https://stylelint.io/user-guide/rules/list/length-zero-no-unit in some case like the usage in CSS variables the unit is necessary for it to work, so it will be nice to add those extra configuration.

Here is an example where this is required:

Doesn't work

--css-variable-1: 0

body.has-some-class { 
    --css-variable-1: 25px;
}

.other-class {
   top: calc(100vh - var(--css-variable-1)) // When this variable is 0 the calc will be invalid
}

Works

--css-variable-1: 0px;

body.has-some-class { 
    --css-variable-1: 25px;
}

.other-class {
   top: calc(100vh - var(--css-variable-1)) 
}