bjankord / stylelint-config-sass-guidelines

⚙ A stylelint config inspired by https://sass-guidelin.es/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

calc w/ scss variable - no error

ELI7VH opened this issue · comments

given the following code:

height: calc(100% - $some-variable); 

the linter should return an error, because it is invalid.

I'm open to a PR for a fix

I would love to, I just don't know the first thing about how this works. Figured you might have a quick fix given you have the domain knowledge.

Anyways. Just wanted to point it out. Thanks!

@ELI7VH why is this invalid? The variable would just be replaced by the value of the variable, and the CSS would be valid.

@binyamin I did a bit more research, and it looks like you have to interpolate the variable. would look like this in the end:

height: calc(100% - #{$some-variable}); 

https://stackoverflow.com/a/20236515