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

fix: values should be replaced in selectors as well #2

Merged
merged 1 commit into from
May 7, 2019

Conversation

jquense
Copy link
Contributor

@jquense jquense commented Feb 15, 2019

No description provided.

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.

Good job, avoid removing ; please

@jquense
Copy link
Contributor Author

jquense commented Feb 15, 2019

BAH sorry, prettier running automatically by accident, i'll fix

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.

Good job 👍

@jquense
Copy link
Contributor Author

jquense commented Feb 15, 2019

@evilebottnawi question for you. I'm ultimately trying to get the following to work:

@value btn from './btn.module.css';

.foo .btn {
  color: red;
}

which (with this change) will work in the isolated case. HOWEVER when used with postcss-modules-scope the .btn class will get mangled as well since it has no sense that the selector class here is an imported value.

There are a few ways I can think to fix this, one is adding support in postcss-modules-scope to not mangle values from :import() that match here, but that seems like it might be too much since it will also create potential conflicts with composes: values.

The other thought was to actual have the value get replaced wrapped in a :global() for selectors, not sure if that will work but i'd like your thoughts...

@alexander-akait
Copy link
Member

@jquense oh, i just maintenance this repo on bug fixes, don't have time on design, so feel free to experiment

@jquense
Copy link
Contributor Author

jquense commented Apr 1, 2019

can we merge 👍 ?

@alexander-akait
Copy link
Member

@jquense yep, do this in near future

@alexander-akait alexander-akait merged commit 0b21653 into css-modules:master May 7, 2019
@jquense jquense deleted the fix-replacement branch May 7, 2019 12:03
@jquense
Copy link
Contributor Author

jquense commented May 7, 2019

thanks!

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.

2 participants