salsify / ember-css-modules

CSS Modules for ambitious applications
MIT License
282 stars 50 forks source link

Introduce scopeBehaviour css-modules option #315

Open krasnoukhov opened 1 year ago

krasnoukhov commented 1 year ago

We're looking to use ember-css-modules for our large apps. We'll be migrating away from ember-component-css. In order to do that seamlessly, we need to turn off behavior for localizing every selector. We want to localize explicitly via :local(.component) { ... } syntax. So I thought I'd propose this change here to this addon. Basically after this one could say scopeBehaviour: 'global' in the config and achieve the behavior I'm talking about.

This is inspired by original postcss-modules option, documented here: https://github.com/madyankin/postcss-modules/tree/v6.0.0#generating-scoped-names See this issue for the context: https://github.com/madyankin/postcss-modules/issues/22#issue-143777964

Seems like they had it since 2016 so I hope this change to this addon would be welcome as well. If this is approved, I can add documentation.

Related PR to the broccoli-css-modules: https://github.com/salsify/broccoli-css-modules/pull/27