Skip to content

Retain whitespace before color(). Fix for #26. #27

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 1 commit into from
Mar 15, 2016

Conversation

studiosciences
Copy link
Contributor

Replace balance-matched with postcss-value-parser to fix issue whitespace removal issue #26.

@studiosciences studiosciences changed the title Retain whitespace before color(). Fix for #27. Retain whitespace before color(). Fix for #26. Mar 8, 2016
@studiosciences
Copy link
Contributor Author

Merged in the branch that used postcss-value-parser.

Minor Issue: We call .toString() even if no actual color functions were found. This would only occur if there was a "color(" in the value that was not actually a color function, such as "hover-color(".

@@ -17,7 +17,7 @@ module.exports = postcss.plugin("postcss-color-function", function() {
}

decl.value = helpers.try(function transformColorValue() {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This try block and helper seems irrelevant now.

Copy link
Member

Choose a reason for hiding this comment

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

color may throw an error.

Copy link
Member

Choose a reason for hiding this comment

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

It would be cool to catch and warn separately.

Copy link
Member

Choose a reason for hiding this comment

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

But in the next pr I think.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

There is a test for throwing a readable error that passes. I assume it passes because colorFn.convert() is the one that throws the error.

There had been a throw error on a mismatched bracket, but that seems irrelevant with postcss-value-parser.

@studiosciences
Copy link
Contributor Author

Are you good to merge then? Version number needs a bump.

@MoOx
Copy link
Contributor

MoOx commented Mar 10, 2016

@studiosciences can you squash your commit (especially the lasts)?
Also why version number needs a bump? According to tests, it's a bugfix.

@studiosciences
Copy link
Contributor Author

@MoOx I haven't squashed before, but I'll see what I can do.

I'll leave any version changing to you.

Replaced balanced-match with post-css-value-parser
@studiosciences
Copy link
Contributor Author

Squashing complete. It appears as one commit in my branch, but the Pull Request lists six.

Not sure how to fix that or if anything needs to be fixed.

@MoOx
Copy link
Contributor

MoOx commented Mar 10, 2016

There is one commit, just refresh the page :D

@studiosciences
Copy link
Contributor Author

Weird. I saw the squashed commit as an additional commit. Looks right now.

@MoOx
Copy link
Contributor

MoOx commented Mar 10, 2016

When you push a commit, github update your open PR, but if you force push, do not remove previous commit until your reload. Pretty buggy UX.

@MoOx
Copy link
Contributor

MoOx commented Mar 10, 2016

Will merge and release tomorrow, I have to go :)

@studiosciences
Copy link
Contributor Author

Anything more I could do to wrap this up?

@MoOx
Copy link
Contributor

MoOx commented Mar 14, 2016

Oh sorry, I forgot. Let me handle this this evening.

MoOx added a commit that referenced this pull request Mar 15, 2016
Retain whitespace before color().  Fix for #26.
@MoOx MoOx merged commit 1bdd1ad into postcss:master Mar 15, 2016
@MoOx
Copy link
Contributor

MoOx commented Mar 15, 2016

Released as 2.0.1, thanks!

@MoOx MoOx mentioned this pull request Mar 15, 2016
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.

3 participants