-
Notifications
You must be signed in to change notification settings - Fork 34
Rewrite of postcss-calc #36
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
Conversation
src/lib/convert.es6
Outdated
case 'ResolutionValue': | ||
return convertAbsoluteLength(left, right, precision); | ||
default: | ||
return { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
return {left, right};
might be a bit nicer. 😄
package.json
Outdated
"main": "index.js", | ||
"scripts": { | ||
"test": "eslint src/**/*.es6 && npm run build && node tests/test.js", | ||
"build": "babel src -d . && jison parser.jison" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be aprepublish
script so that it is run before publishing to npm.
package.json
Outdated
@@ -1,6 +1,6 @@ | |||
{ | |||
"name": "postcss-calc", | |||
"version": "5.3.1", | |||
"version": "6.0.0", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you remove the version bump from here please? https://github.com/sindresorhus/np takes care of this. 😄
Disable rounding when precision is false.
This rewrite is done with the intent of fixing inconsistent behaviour between postcss-calc and the W3C specification, as well as enabling better optimisation of
calc()
expressions. The rewrite is done from the ground-up in ES6 while still staying compatible with the existing API. It reducescalc()
functions by transforming ASTs generated from the expressions.The rewrite also solves the following issues:
calc
on the name #35