Skip to content

class names not scoped using the "use" api #50

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

Closed
themitchy opened this issue Oct 8, 2015 · 2 comments
Closed

class names not scoped using the "use" api #50

themitchy opened this issue Oct 8, 2015 · 2 comments

Comments

@themitchy
Copy link

If any plugins are specified via the use option, class names will not be scoped. Worse yet it's not plugin specific because an empty array still results in no scoping of classnames.

css:

.widget {
  display: flex;
}

plugin configuration:

b.plugin(cssModulesify, {
   rootDir: '../',
   output: './dist/foo.css',
   use: [ autoprefixer ]
});

With the above the generated css is:

.widget {
  display: -webkit-inline-box;
  display: -webkit-inline-flex;
  display: -ms-inline-flexbox;
  display: inline-flex;
}

With use: [ ] the class name is still not scoped. With use completely removed the class will be scoped correctly.

Seems like css-modules + plugins is too common a use case to not support it.

@themitchy
Copy link
Author

Nope, I'm dumb. Should be using postcssAfter instead of use.

@joshwnj
Copy link
Member

joshwnj commented Oct 8, 2015

You're right @themitchy , this is a bit confusing because it doesn't make so much sense if use drops the very plugins that make css modules work. We hope to address this point (and some others) when we go to v1.0 (discussion in #29)

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

No branches or pull requests

2 participants