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
{{ message }}
This repository was archived by the owner on Aug 28, 2026. It is now read-only.
Repository navigation
This repository was archived by the owner on Aug 28, 2026. It is now read-only.
Imported local aliases not working when used in selectors #561
Reporting css-modules/icss#12 for visibility. I'll copy the details, but I'm experiencing the exact same issue.
Do you want to request a feature or report a bug?
bug report
What is the current behavior?
// foo.scss
.foo{color: blue;}
// bar.css
:import("foo.css"){fooClassName: foo;}.fooClassName.bar{ // <-- this doesn't get replaced :(
color: red;}
// baz.css
:import("foo.css"){fooClassName: foo;}.baz{color: fooClassName; // <-- this does get replaced :)
}
What is the expected behavior? fooClassName is replaced with the local name for foo from foo.css in both bar.scss and `baz.scss
Please mention other relevant information such as your webpack version, Node.js version and Operating System.
I'm currently testing with webpack 2.2.1, node 7.2.1, css-loader 0.28.4.
Okay, I'm diving in and have this PR, which partially solves this -- css-modules/postcss-icss-selectors#119 -- with a PR for this repo as well. It'll require updating to the more recent version of css-modules' icss loaders, but seems to be working well locally.
Did you see the new-loader branch ? I highly appreciate your current work, but we need to be careful to not introduce breaking changes within the semver minor range of this loader atm. The intemediate goal is to release a new semver major of css-loader and move CSSM to postcss-loader as a standalone plugin, while css-loader only parses the ICSS Tokens. postcss-modules (Plugin Wrapper), postcss-loader (result.messages [ICSS Tokens Export]) and import @media query parsing (ICSS v2) are missing. In case your upcoming PR is backwards compatible forget what I said then 😛
Oh cool, that's very good to know. I was thinking about how it would be nice to use postcss for my modules, but the fact that the loader needs to know about the exports was blocking. That sounds like it'll help a lot with my issues.
I've got a draft of the PR and it might be backwards compatible (just need to investigate why some tests are failing). I'm going to push it up just so folks can look at it, but if it turns out to not be backwards compatible I won't worry.
Activity
apexskier commentedon Jun 23, 2017
It looks like this mght be fixed in a newer version of
icss-utilscss-modules/icss-utils@19ffee9However, linking a local version of
css-loaderwithicss-utilsupgraded doesn't resolve the problem.apexskier commentedon Jun 23, 2017
Okay, I'm diving in and have this PR, which partially solves this -- css-modules/postcss-icss-selectors#119 -- with a PR for this repo as well. It'll require updating to the more recent version of css-modules' icss loaders, but seems to be working well locally.
michael-ciniawsky commentedon Jun 23, 2017
Did you see the new-loader branch ? I highly appreciate your current work, but we need to be careful to not introduce breaking changes within the semver minor range of this loader atm. The intemediate goal is to release a new semver major of
css-loaderand move CSSM topostcss-loaderas a standalone plugin, whilecss-loaderonly parses the ICSS Tokens.postcss-modules(Plugin Wrapper),postcss-loader(result.messages[ICSS Tokens Export]) and import@mediaquery parsing (ICSS v2) are missing. In case your upcoming PR is backwards compatible forget what I said then 😛apexskier commentedon Jun 23, 2017
Oh cool, that's very good to know. I was thinking about how it would be nice to use postcss for my modules, but the fact that the loader needs to know about the exports was blocking. That sounds like it'll help a lot with my issues.
I've got a draft of the PR and it might be backwards compatible (just need to investigate why some tests are failing). I'm going to push it up just so folks can look at it, but if it turns out to not be backwards compatible I won't worry.
alexander-akait commentedon Feb 13, 2018
Closing if favor
css-loader/nextandpostcss-loaderor css as first citizen in webpack. It is rfc/porpalse and should be resolve in https://github.com/css-modules/icss. Thanks for issue!apexskier commentedon May 22, 2018
What's the status on this?