Skip to content

fix(pack): :global() syntax under nested transform err - #2455

Merged
fireairforce merged 2 commits into
nextfrom
fix-2395
Dec 25, 2025
Merged

fix(pack): :global() syntax under nested transform err#2455
fireairforce merged 2 commits into
nextfrom
fix-2395

Conversation

@fireairforce

@fireairforce fireairforce commented Dec 25, 2025

Copy link
Copy Markdown
Member

Summary

修复 :global() syntax 在 css modules 嵌套下的 transform 问题。

closes: #2395

Input / Output 如图所示:

image

主要来自对 ligntingcss transform 的修改: utooland/lightningcss@2cf0881

Test Plan

快照测试变了。

@fireairforce fireairforce changed the title fix(pack): :global() syntax under nested transform err fix(pack): :global() syntax under nested transform err Dec 25, 2025
@gemini-code-assist

Copy link
Copy Markdown
Contributor

Summary of Changes

Hello @fireairforce, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request resolves a critical bug concerning the :global() syntax within nested CSS modules. Previously, these global selectors were not being transformed correctly, leading to unexpected styling behavior. By updating the underlying lightningcss dependency to a version that includes the fix, this PR ensures that :global() rules are processed as intended, maintaining the integrity of CSS module encapsulation while allowing for global overrides where necessary.

Highlights

  • Fix for :global() syntax: Corrects an issue where :global() syntax was not properly transformed when nested within CSS modules, ensuring correct styling.
  • lightningcss dependency update: Updates the lightningcss library and related packages to a specific commit that includes the necessary fix for the global syntax transformation.
  • Updated snapshot tests: Includes changes to snapshot tests to validate the corrected behavior and output of CSS module transformations, reflecting the fix.

🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console.

Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Code Review

这个 PR 通过更新 lightningcss 依赖,修复了在 CSS modules 嵌套下使用 :global() 语法时的转换问题。相关的快照测试也已更新,以验证此修复。整体实现是正确的。我发现了一个关于可能被意外提交的文件的小问题,请查看我的具体评论。

Comment thread crates/pack-tests/tests/snapshot/Users/zoomdong/output/main.js Outdated
@fireairforce
fireairforce merged commit bbb7015 into next Dec 25, 2025
20 of 21 checks passed
@fireairforce
fireairforce deleted the fix-2395 branch December 25, 2025 17:12
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.

[Utoopack] :global() syntax under nested transform error

1 participant