-
Notifications
You must be signed in to change notification settings - Fork 18
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
Using imported value in rgba() #17
Comments
+1 for this. I've got the same issue... :( |
Having a similar issue using With css-modules/postcss-modules-values@e8345f9 it works for me with a locally defined value but not a value imported from another file, i.e.: // works
@value navbarHeight: 50px;
// doesn't work
@value navbarHeight from 'shared/styles/constants.css';
.panel {
width: 350px;
height: calc(100vh - navbarHeight);
} |
Possibly related, I get a silent fail when using
Above code causes watchify to just hang, no error message. |
@jedrichards I think this is a case where you've ran into some of CSS Modules' limitations; because it's run after all postcss plugins, all of the transpiled functions are expanded before the value definitions are exported / imported. The same applies for functions available in other preprocessors. The css-next color plugin probably can't find a color reference for |
same issue here, using color() from cssnext the value results in i__const... |
same issue, this is still broken. @ctaepper checking the order of my plugins was promising to me at first too lol. Must be a bug in the plugin. Has anyone been working on this? |
I wrote a workaround to overcome this flaw in CSS Modules — https://github.com/princed/postcss-modules-values-replace. I'd love to have some feedback on it. Update: However, color computations won't work inside @value out of the box, as postcss-color-function doesn't traverse media queries. |
Any news here? |
This is an interesting question. If this isn't solved since a year, what is the preferred way to import variables? |
Any update on this problem? |
@phamcharles PR welcome |
css community needs to figure out a way to do color conversion easily. Otherwise it'll be more and more variables for the same purpose. |
I have the following:
The output of this that I see in the browser is (similar to):
The value for
midnight
is not being interpolated correctly in the rgba() instance.This occurs with
[email protected]
and withpostcss-loader
removed from my webpack configuration (I thought maybe one of my postcss plugins were conflicting).Is this a bug? Or an unsupported use case?
The text was updated successfully, but these errors were encountered: