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

feat: add exportGlobals option #1052

Closed
wants to merge 1 commit into from

Conversation

david-zw-liu
Copy link

@david-zw-liu david-zw-liu commented Mar 17, 2020

This PR contains a:

  • bugfix
  • new feature
  • code refactor
  • test update
  • typo fix
  • metadata update

Motivation / Use-Case

This option exports names from global id or class, so we can use the same way like local names to reference global names. It will be helpful to switch between local and global modes.

example:

/* example.css */

:local(.foo) {
  background-color: #000;
}

:global(.bar) {
  background-color: #aaa;
}
import css from 'example.css';

console.log(css.foo); // => "hashed class name"
console.log(css.bar); // => "bar"

Breaking Changes

No

Additional Info

Related issues:
#258

Related PRs:
css-modules/postcss-modules-scope#21

Hi @evilebottnawi ,
Could you help me to release a new version of postcss-modules-scope package?
Then I will update the package version of this PR.
Package version updated.

Thanks.

@jsf-clabot
Copy link

jsf-clabot commented Mar 17, 2020

CLA assistant check
All committers have signed the CLA.

package.json Outdated Show resolved Hide resolved
@david-zw-liu
Copy link
Author

david-zw-liu commented Mar 18, 2020

Hi @evilebottnawi ,
Shall I fix npm audit errors in this PR or create a new PR related to that?

Thanks.


Sorry. I cannot fix npm run audit until all dependent packages be upgraded. 😭

@alexander-akait
Copy link
Member

@msglight4874 ignore it

Copy link
Member

@alexander-akait alexander-akait left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Documentation is wrong, need fix

README.md Outdated Show resolved Hide resolved
@david-zw-liu
Copy link
Author

Hi @evilebottnawi ,

I fixed document and version in package.json already.
Please review this PR again.

Thanks

Copy link
Member

@alexander-akait alexander-akait left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, thanks

jamesgeorge007
jamesgeorge007 previously approved these changes Mar 20, 2020
@david-zw-liu
Copy link
Author

HI @evilebottnawi ,
I rebased this PR with latest master. Can this PR be merged into master?

Thanks

@alexander-akait
Copy link
Member

@msglight4874 Yes, merge and release will be in near future, need do some improvements for next release

@david-zw-liu
Copy link
Author

Ok, thanks.

@alexander-akait
Copy link
Member

Close in favor #1069, we have some conflicts, so as not to wait for fix and do the next release as soon as possible (we have already spent a lot of time on a release), I will send a new PR with more tests, anyway big thanks for helping us and good code

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

Successfully merging this pull request may close these issues.

None yet

5 participants