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

feat: support less each function #127

Merged
merged 1 commit into from
Nov 14, 2018
Merged

feat: support less each function #127

merged 1 commit into from
Nov 14, 2018

Conversation

shellscape
Copy link
Owner

Which issue # if any, does this resolve?

Please check one:

  • New tests created for this change
  • Tests updated for this change

This PR:

  • Adds new API
  • Extends existing API, backwards-compatible
  • Introduces a breaking change
  • Fixes a bug

This PR fixes #121 by adding relatively naive support for the new each function in LESS. each is relatively unique, as it's the only function used at the root level, outside of a ruleset. While this change doesn't do anything special with the params, it allows the parser to continue on without throwing an error.

The result is an AtRule with a function: true property, and params property which contains everything between the first and last, open and closed parenthesis.

In the future we might examine how to parse and present the params for each in the node.

@shellscape shellscape requested a review from jwilsson November 14, 2018 15:27
@codecov-io
Copy link

Codecov Report

Merging #127 into master will increase coverage by 0.35%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #127      +/-   ##
==========================================
+ Coverage   95.74%   96.09%   +0.35%     
==========================================
  Files           8        8              
  Lines         188      205      +17     
==========================================
+ Hits          180      197      +17     
  Misses          8        8
Impacted Files Coverage Δ
lib/LessStringifier.js 87.5% <100%> (+0.54%) ⬆️
lib/LessParser.js 98.92% <100%> (+0.22%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 9392246...adca450. Read the comment docs.

Copy link
Collaborator

@jwilsson jwilsson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like this idea, putting everything into params, better too. I'd argue that everything are parameters and parsing that should be easy enough if someone wants to parse it further.

Code LGTM too.

@shellscape shellscape merged commit e3731c3 into master Nov 14, 2018
@shellscape shellscape deleted the feat/each branch November 14, 2018 18:59
@shellscape
Copy link
Owner Author

🎉

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.

Support each function
3 participants