Skip to content

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

Merged
merged 21 commits into from
May 8, 2017
Merged

Rewrite of postcss-calc #36

merged 21 commits into from
May 8, 2017

Conversation

andyjansson
Copy link
Contributor

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 reduces calc() functions by transforming ASTs generated from the expressions.

The rewrite also solves the following issues:

case 'ResolutionValue':
return convertAbsoluteLength(left, right, precision);
default:
return {
Copy link
Member

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"
Copy link
Member

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",
Copy link
Member

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. 😄

@ben-eb ben-eb merged commit bdb056a into postcss:master May 8, 2017
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.

2 participants