Skip to content

fix(docs): token color chunk popover preview sync (#1994) - #164

Merged
cc-hearts merged 1 commit into
mainfrom
sync/ant-design-x-1994
Aug 4, 2026
Merged

fix(docs): token color chunk popover preview sync (#1994)#164
cc-hearts merged 1 commit into
mainfrom
sync/ant-design-x-1994

Conversation

@cc-hearts

Copy link
Copy Markdown
Member

🤔 This is a ...

  • 🐞 Bug fix
  • 📝 Site / documentation improvement

🔗 Related Issues

💡 Background and Solution

Syncing upstream PR ant-design/x#1994 to fix the Token color-chunk Popover preview.

The docs color-chunk component read a non-existent --antd-arrow-background-color on its root, while the current antdv-next Popover actually reads --ant-tooltip-arrow-background-color. This made the popover arrow default to the theme arrow color instead of the actual Token color.

Changes:

  • Use --ant-tooltip-arrow-background-color for the Popover arrow so it matches the Token color.
  • Add destroyOnHidden so the preview DOM is removed after closing.
  • Remove the now-unnecessary transparent root background override.

📝 Change Log

Language Changelog
🇺🇸 English Fix the docs Token color-chunk popover preview so the container and arrow show the actual Token color, and destroy the preview DOM on close.
🇨🇳 Chinese 修复文档 Token 色块 Popover 预览,容器与箭头显示实际 Token 颜色,并在关闭后销毁预览 DOM。

- Use --ant-tooltip-arrow-background-color for the popover arrow
- Add destroyOnHidden to remove preview DOM on close
- Drop redundant transparent root background override
@cc-hearts
cc-hearts merged commit 88d4480 into main Aug 4, 2026
1 check passed
@cc-hearts
cc-hearts deleted the sync/ant-design-x-1994 branch August 4, 2026 02:45
@cc-hearts

Copy link
Copy Markdown
Member Author

Review:⚠️ 逻辑通顺,但核心断言需要人工验证后再合

三处改动本身都说得通:

  1. destroyOnHidden —— 关闭后销毁预览 DOM,对应验收标准第二条 ✅
  2. 移除 backgroundColor: "transparent" —— styles.container 已经设了 backgroundColor: dotColor,root 上的透明覆盖确实是多余的 ✅
  3. arrow 变量从 --antd-arrow-background-color 换成 --ant-tooltip-arrow-background-color —— 这条我无法验证

需要确认的点

整个 PR 的成败全押在第 3 条那个变量名对不对上。如果 antdv-next 的 Popover 实际读的不是这个名字,箭头颜色不会变,PR 等于没修,而 diff 看起来又完全合理,很容易就这么合进去了。

我这边验证不了:仓库未安装 node_modules,antdv-next 源码也拉不到(raw 404 / code search 需登录)。已知 antd v5 用的是 --antd-arrow-background-color,antdv-next 是否重命名过无法确认。

建议合并前本地起一次 docs,在 DevTools 里看一眼 .ant-tooltip 根元素上真实的 CSS 变量名,顺带按验收标准过一遍浅色 / 深色 / rgba token 三种情况。确认无误后即可合并,我没有其他意见。

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.

[sync][P3] docs: 修复 Token 色块 Popover 预览 (#1994)

1 participant