-
Notifications
You must be signed in to change notification settings - Fork 282
fix(countup): 分隔符文字颜色支持css变量修改 #2871
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
Conversation
概述演练此次更改主要关注 AnimatingNumbers 组件的分隔符颜色定制。通过引入新的 CSS 变量 变更
可能相关的 PR
建议标签
建议审阅者
诗歌
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## feat_v3.x #2871 +/- ##
==========================================
Coverage 84.56% 84.56%
==========================================
Files 273 273
Lines 18609 18609
Branches 2693 2693
==========================================
Hits 15737 15737
Misses 2867 2867
Partials 5 5 ☔ View full report in Codecov by Sentry. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Nitpick comments (2)
src/packages/animatingnumbers/demos/h5/demo2.tsx (1)
10-10
: 建议使用不同的颜色来更好地展示分隔符自定义功能当前示例中分隔符颜色与背景色使用相同的变量
var(--nutui-color-primary)
,这可能不是最佳的演示方案。建议使用不同的颜色来更清晰地展示分隔符颜色可以独立自定义的特性。- nutuiCountupSeparatorColor: `var(--nutui-color-primary)`, + nutuiCountupSeparatorColor: `var(--nutui-color-text)`,src/packages/animatingnumbers/doc.taro.md (1)
56-56
: 建议完善组件主题定制文档文档更新覆盖了所有语言版本,新增的分隔符颜色自定义功能文档完整。建议考虑以下几点完善:
- 在组件的 README.md 中添加主题定制的示例代码
- 补充在线预览 Demo 展示不同颜色配置的效果
- 考虑添加暗黑模式下的默认颜色配置说明
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (8)
src/packages/animatingnumbers/countup.scss
(1 hunks)src/packages/animatingnumbers/demos/h5/demo2.tsx
(1 hunks)src/packages/animatingnumbers/demos/taro/demo2.tsx
(1 hunks)src/packages/animatingnumbers/doc.en-US.md
(1 hunks)src/packages/animatingnumbers/doc.md
(1 hunks)src/packages/animatingnumbers/doc.taro.md
(1 hunks)src/packages/animatingnumbers/doc.zh-TW.md
(1 hunks)src/styles/variables.scss
(1 hunks)
🔇 Additional comments (7)
src/packages/animatingnumbers/demos/taro/demo2.tsx (1)
10-10
: 保持与 H5 版本一致的颜色修改
为保持示例的一致性,建议与 H5 版本采用相同的颜色修改方案。
src/packages/animatingnumbers/countup.scss (1)
27-27
: 样式变更符合预期
使用 $countup-separator-color
变量来控制分隔符颜色的实现方式正确,同时保持了原有的样式特性。
src/packages/animatingnumbers/doc.md (1)
56-56
: 新增的 CSS 变量定义正确且清晰
新增的 --nutui-countup-separator-color
CSS 变量的定义完整,默认值设置合理。建议验证 $color-title
变量在主题系统中的定义。
✅ Verification successful
Let me check the actual definition of $color-title
in these files to ensure it's properly defined.
CSS 变量定义正确且主题变量已确认
--nutui-countup-separator-color
使用的 $color-title
变量已在主题系统中正确定义,默认值为 #1a1a1a
,且支持通过 CSS 变量 --nutui-color-title
进行自定义。变量定义完全符合组件主题系统的规范。
🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash
# 检查 $color-title 变量在样式文件中的定义
rg -l '\$color-title' src/styles/
Length of output: 124
Script:
#!/bin/bash
# Check the definition of $color-title in the style files
rg '\$color-title\s*:' src/styles/
Length of output: 221
src/packages/animatingnumbers/doc.zh-TW.md (1)
56-56
: 繁体中文文档更新正确
新增的 CSS 变量说明翻译准确,格式规范,与其他语言版本保持一致。
src/packages/animatingnumbers/doc.taro.md (1)
56-56
: Taro 文档更新正确,建议补充示例验证
新增的 CSS 变量文档更新正确。建议在 demo2.tsx 中添加对该 CSS 变量的实际使用示例,以便用户理解如何在 Taro 环境中正确使用该特性。
✅ Verification successful
CSS 变量已在 Demo 中正确使用,无需额外示例
Demo2.tsx 中已经通过 ConfigProvider 展示了如何自定义 nutuiCountupSeparatorColor
变量,为用户提供了完整的使用示例。文档与实际代码实现保持一致。
🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash
# 检查 demo 文件中是否包含新 CSS 变量的使用示例
rg --type tsx 'nutui-countup-separator-color' src/packages/animatingnumbers/demos/taro/
Length of output: 115
Script:
#!/bin/bash
# Check demo files for CSS variable usage with proper file extension
rg 'nutui-countup-separator-color' src/packages/animatingnumbers/demos/taro/
# List demo files to verify their existence and extension
fd . src/packages/animatingnumbers/demos/taro/
Length of output: 227
Script:
#!/bin/bash
# Check content of demo files
cat src/packages/animatingnumbers/demos/taro/demo1.tsx src/packages/animatingnumbers/demos/taro/demo2.tsx
# Check if there are any CSS/style related files in the demos directory
fd '\.(scss|css|less)$' src/packages/animatingnumbers/demos/taro/
Length of output: 1255
src/packages/animatingnumbers/doc.en-US.md (1)
56-56
: 文档更新正确且完整!
CSS 变量的文档说明清晰地描述了分隔符文字颜色的配置选项。
src/styles/variables.scss (1)
2426-2429
: 变量定义规范且实现正确!
新增的分隔符颜色变量:
- 命名规范统一
- 默认值设置合理
- 位置放置正确
- 实现方式符合主题定制要求
🤔 这个变动的性质是?
🔗 相关 Issue
💡 需求背景和解决方案
☑️ 请求合并前的自查清单
Summary by CodeRabbit
新功能
--nutui-countup-separator-color
,用于自定义计数器组件中分隔符的颜色。文档更新
AnimatingNumbers
组件的文档,以包含新的CSS变量,增强了样式自定义选项。样式
$countup-separator-color
,以支持分隔符颜色的灵活自定义。