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

composes order #131

Closed
sullenor opened this issue Mar 3, 2017 · 5 comments
Closed

composes order #131

sullenor opened this issue Mar 3, 2017 · 5 comments

Comments

@sullenor
Copy link
Member

sullenor commented Mar 3, 2017

Just wanted to add the issue as a reminder of the unpleasant use case.

In case there is a selector with a multiple composes rules and another preceding one, which contains the same composes rules, but in the another order, it may result in the confusing order of the resulting css.

For example:

.localA {
  composes: D from './d.css';
}

.localB
{
  composes: F from './f.css';
  composes: D from './d.css'; /* should come after f.css */
}

transforms into

:import("./d.css") {
  i__imported_D_0: D
}

:import("./f.css") {
  i__imported_F_1: F
}

...

:export {
  localA: _source_localA i__imported_D_0;
  localB: _source_localB i__imported_F_1 i__imported_D_0
}

which means, that the contents of the d.css will be loader before f.css.
That may lead to a small collapse for the .localB selector in case F and D contain similar rules.

Relates to css-modules/css-modules#12

@delijah
Copy link

delijah commented May 8, 2017

Any progress on this?! This is quite annoying!

@sullenor
Copy link
Member Author

It's published as prerelease and available under dist tag.
To install it manually you should use npm i postcss-modules-extract-imports@next.

@sullenor
Copy link
Member Author

@sgal
Copy link

sgal commented Dec 5, 2017

Is there any plan to get this published? Do you need any help with testing etc.? This issue was biting us for quite some time already, so it'd be great to have it published.

@sullenor
Copy link
Member Author

It is published for now (2.0.0).

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

No branches or pull requests

3 participants