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

Fixes #3205, partial 3.0 math regression #1880 #3228

Merged
merged 5 commits into from
Jun 27, 2018

Conversation

matthew-dean
Copy link
Member

@matthew-dean matthew-dean commented Jun 24, 2018

This PR does the following:

  • Fixes Variables in detached rulesets not visited by visitor? #3205 - Mixin args not visited by visitor
  • Improves permissive parsing quite a bit - first parses a stream of parseable entities (vars, function calls, but not math expressions*), and if that doesn't work, drops back to permissive parsing for the rest. This ensures that permissive parsing doesn't re-break Variables in detached rulesets not visited by visitor? #3205 when released, as permissive was previously parsing the @bar in --foo: @bar as an escaped quoted value. Instead, it returns the expected Variable node, and visitVariable will continue to work on the pre-eval test
  • Fixes the apparent math regression in 3.0 where media queries were, for a time in 2.x, I guess, not evaluating 16/9 as math? (See: Current version of less breaks media query aspect ratios jonycheung/deadsimple-less-watch-compiler#69) Now, media queries parse as a permissive value, which doesn't perform math operations. This doesn't "fix math" whatsoever, it just makes a @media behave more consistently with other at-rules (with this update), which don't allow math either.
  • The reason that permissive parsing doesn't parse math expressions is that they're too ambiguous and also hard for the parser to recover from. A custom property could, for example, contain a math expression that's not intended as "Less math".

@matthew-dean matthew-dean added this to the 3.5 milestone Jun 25, 2018
@matthew-dean matthew-dean merged commit 566f428 into less:master Jun 27, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Variables in detached rulesets not visited by visitor?
1 participant