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

Failed to transform CSS modules with :global in some cases: .foo:global(.bar).baz {} #8461

Closed
JSerFeng opened this issue Dec 29, 2023 · 3 comments · Fixed by #8926
Closed
Assignees
Labels
Milestone

Comments

@JSerFeng
Copy link
Contributor

JSerFeng commented Dec 29, 2023

Describe the bug

Currently SWC CSS modules fail to transpile

 .foo:global(.bar).baz {}

but do transpile follow ing successfully

 .foo :global(.bar).baz {}

You can reproduce this in SWC repo by adding the following code:

image

notice the last item has been stripped

Input code

Input


.foo:global(.bar).baz {}


Output like:

```css
._local_foo.bar {
    color: white;
}


### Config

_No response_

### Playground link (or link to the minimal reproduction)

https://github.com/swc-project/swc/tree/main/crates/swc_css_modules/tests/fixture/modules/pure

### SWC Info output

_No response_

### Expected behavior

```css
 ._local_foo.bar._local_baz {}

Actual behavior

No response

Version

latest

Additional context

No response

@zDaoYang
Copy link

zDaoYang commented Feb 19, 2024

@kdy1
I have met the same issue, makes project refactoring difficult
Is there any progress?
thanks a lot~

@emosheeep

This comment has been minimized.

@swc-bot
Copy link
Collaborator

swc-bot commented Jun 7, 2024

This closed issue has been automatically locked because it had no new activity for a month. If you are running into a similar issue, please create a new issue with the steps to reproduce. Thank you.

@swc-project swc-project locked as resolved and limited conversation to collaborators Jun 7, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Development

Successfully merging a pull request may close this issue.

5 participants