You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The value for midnight is not being interpolated correctly in the rgba() instance.
This occurs with css-loader@1.1.0 and with postcss-loader removed from my webpack configuration (I thought maybe one of my postcss plugins were conflicting).
@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 foo and then silently hangs.
same issue here, using color() from cssnext the value results in i__const...
however i think the values plugin should run before cssnext, as i defined this order in my postcss plugin chain... so why is this not working?
Activity
jgrancher commentedon Dec 3, 2015
+1 for this. I've got the same issue... :(
jamesmccann-zz commentedon Dec 28, 2015
Having a similar issue using
calc.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.:
jedrichards commentedon Jan 29, 2016
Possibly related, I get a silent fail when using
css-modulesifywithpostcss-cssnextand trying to use acolor()function on an imported@value.Above code causes watchify to just hang, no error message.
color()function works as expected when not used on a@value.sohkai commentedon Feb 22, 2016
@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
fooand then silently hangs.ctaepper commentedon May 14, 2016
same issue here, using color() from cssnext the value results in i__const...
however i think the values plugin should run before cssnext, as i defined this order in my postcss plugin chain... so why is this not working?
tomsapps commentedon Nov 16, 2016
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?
princed commentedon Nov 17, 2016
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.
nglazov commentedon Jun 1, 2017
Any news here?
pczern commentedon Mar 23, 2018
This is an interesting question. If this isn't solved since a year, what is the preferred way to import variables?
phamcharles commentedon Aug 20, 2018
Any update on this problem?
alexander-akait commentedon Aug 21, 2018
@phamcharles PR welcome
windmaomao commentedon Jun 14, 2023
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.