Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
victorg1991 opened this issue Jul 18, 2022 · 0 comments

Comments

@victorg1991
Copy link
Member

victorg1991 commented Jul 18, 2022

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)) 
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants