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

postcss-color-function support #23

Closed
max opened this issue Apr 20, 2016 · 4 comments
Closed

postcss-color-function support #23

max opened this issue Apr 20, 2016 · 4 comments
Labels

Comments

@max
Copy link

max commented Apr 20, 2016

Currently it isn't possible to use an imported @value in a PostCSS color function. For example:

@value --light-gray from "things/styles/colors";

.foobar {
  background: color(--light-gray alpha(50%));
}

This results in:

Unable to parse color from string "i__const___light_gray_473"

By comparison this works fine:

@value --light-gray: #999;

.foobar {
  background: color(--light-gray alpha(50%));
}

I also tried moving postcss-color-function to the before hook but then the error message is:

Unable to parse color from string "--light-gray"

Which makes sense given that at that stage it's just a string.

@max
Copy link
Author

max commented Apr 20, 2016

Looks like this might be blocked by css-modules/postcss-modules-values#5.

@dfreeman
Copy link
Member

I get the distinct impression you're the first person to use this who already has a preferred suite of PostCSS plugins :)

I probably won't get a chance to dig in on this one for a few days, but the issue you linked looks like a good starting point. I may need a new issue label for "stuff I'm pretty sure is the underlying loader's fault but haven't actually tracked down yet."

@dfreeman dfreeman added the bug label Apr 20, 2016
@dfreeman
Copy link
Member

dfreeman commented May 2, 2016

Just released 0.3.2, which includes a broccoli-css-modules version bump that should take care of this.

@dfreeman dfreeman closed this as completed May 2, 2016
@NullVoxPopuli
Copy link

I get the distinct impression you're the first person to use this who already has a preferred suite of PostCSS plugins :)

count me as #2, I guess.
I'm having a hard time getting my previously working postcss config working with css-modules (only adopted for component-co-location support)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants