Skip to content

composes / compose-with for global CSS class names #23

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
danielweck opened this issue Apr 1, 2020 · 3 comments
Closed

composes / compose-with for global CSS class names #23

danielweck opened this issue Apr 1, 2020 · 3 comments

Comments

@danielweck
Copy link

The documentation gives this example ( https://github.com/css-modules/css-modules#composing-from-global-class-names ):

.otherClassName {
  composes: globalClassName from global;
}

...but the syntax supported by postcss-modules-scope is in fact:

.otherClassName {
  composes: global(globalClassName);
}

...as I discovered in the code:

const global = /^global\(([^\)]+)\)$/.exec(className);

So, should this be documented somewhere?

Thanks for this piece of software though, keep up the good work! :)

@danielweck
Copy link
Author

PS: I am using this handy "wrapper" https://github.com/sgtpep/csstag

@DiscreteBites
Copy link

Thanks for finding out! This has been bugging me for weeks. The documentation should really reflect this somewhere.

@alexander-akait
Copy link
Member

Expected, because https://github.com/css-modules/postcss-modules-extract-imports/ converts globalClassName from global to global(globalClassName) for internal purposes

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

3 participants