-
-
Notifications
You must be signed in to change notification settings - Fork 601
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
ICSS: Importing a composed class name produces wrong output #997
Comments
Thanks for issue i will look on this in near future |
I have the same. After update all new |
@yakato please create reproducible test repo |
Might be related to #561, which has a minimal reproduction. |
@apexskier That's a different issue, about imports not working at all. That has since been fixed, as far as I can tell. The remaining issue is that specifically composed class names are not handled correctly, for which I've provided a reproduction in the initial report above. |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
Sorry for delay, WIP on the issue, maybe we need improve our architecture, also it is allow to validate existing names and throw an error on the build step |
Here big problem 😞 @joepie91 You example is broken too. Example: inner-box.css @value shadow: 10px 5px 5px red;
.innerBox {
composes: box from "./shared.css";
width: 64px;
height: 64px;
background-color: red;
} outer-box.css :import("./inner-box.css") {
importedInnerBox: innerBox;
}
@value shadow from './inner-box.css';
.outerBox {
composes: box from "./shared.css";
width: 100px;
height: 100px;
background-color: blue;
box-shadow: shadow;
}
.outerBox .importedInnerBox {
background-color: lime;
} And look at bundle:
We replace spaces on Don't know how we can solve it, because we don't know this values on the build step and don't know context, what we know? Only value. |
I postpone it for v5, now it is the limitation |
Here other problem you can import selector from other file and it is not hashed, using |
This seems like a bug in
I'm not sure what you mean with this. Can you give an example? |
Any workaround for this issue? |
Expected Behavior
css-loader
should produce correct output:Actual Behavior
css-loader
produces incorrect output:Code
See below.
How Do We Reproduce?
Full repro case here: https://git.cryto.net/joepie91/icss-loader-test
Run
yarn webpack
to produce output with Webpack + css-loader (incorrect output), runyarn browserify-extract
to produce output with Browserify + icssify (correct output).Both output to the same files, so you can switch between them. Open
test/index.html
in a browser to see the result.The bug is caused by the
import
handling using the JS/HTML-formatted (space-delimited) export, rather than a CSS-formatted (dot-delimited) export.This means that when using a composed identifier (which consists of two space-delimited class names) as an imported identifier, the resulting selector rule will be broken (see code snippets above).
This can be fixed by replacing spaces with dots in the case of ICSS imports.
The text was updated successfully, but these errors were encountered: