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

space-around-operator incorrectly enforces negative z-index #454

Closed
Dru89 opened this issue Dec 14, 2015 · 7 comments
Closed

space-around-operator incorrectly enforces negative z-index #454

Dru89 opened this issue Dec 14, 2015 · 7 comments
Labels

Comments

@Dru89
Copy link
Contributor

Dru89 commented Dec 14, 2015

It looks like space-around-operator's exception handling is missing some cases where negative numbers don't necessarily have a dimension or percentage. For instance, the following should be valid CSS:

.foo {
  z-index: -1;
}

Unfortunately, it looks like the space-around-operator rule expects that - to have a space before it. Putting a space before it actually breaks the AST, though.

@alfaproject
Copy link

Indeed, noticed this today and was going to report it.

@Dru89
Copy link
Contributor Author

Dru89 commented Dec 15, 2015

There are some other scenarios where you can run into this, too, like the expression:

.foo {
  margin: -1 * ($foo + $bar + $baz);
}

@benthemonkey
Copy link
Member

Confirmed. Was able to reproduce with the examples above.

This rule isn't about including units, so maybe we don't need to do the check that a value is followed by a dimension or a percent sign? https://github.com/sasstools/sass-lint/blob/develop/lib/rules/space-around-operator.js#L51

@bgriffith
Copy link
Member

Thanks for the report. I'm sure there was a reason at looking for units around manipulating the parser. I'll try and have a look at it today and hotfix it.

@SimonFinney
Copy link

@bgriffith Is there any updates on this issue?

@bgriffith
Copy link
Member

@SimonFinney Thanks for the prod. I've pushed a PR to develop. Hopefully we can do a release this week.

@SimonFinney
Copy link

👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants