-
Notifications
You must be signed in to change notification settings - Fork 280
fix(countdown): update the v15 style #2843
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
Walkthrough本次更改涉及多个文件,主要集中在倒计时组件的样式和功能上。在 Changes
Possibly related PRs
Suggested labels
Suggested reviewers
Poem
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 #2843 +/- ##
==========================================
Coverage 84.14% 84.14%
==========================================
Files 273 273
Lines 18103 18103
Branches 2690 2690
==========================================
Hits 15232 15232
Misses 2866 2866
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
🧹 Outside diff range and nitpick comments (4)
src/packages/countdown/countdown.scss (1)
15-19
: 样式属性的改进增强了组件的一致性添加的 box-sizing 和 line-height 属性有助于确保组件在不同场景下的布局一致性。不过,建议重新考虑使用特定字体 'JD',因为:
- 可能不是所有环境都能访问这个字体
- 应该提供降级字体选项
建议修改为:
box-sizing: border-box; font-weight: $coutdown-font-weight; font-size: $countdown-font-size; line-height: calc($countdown-font-size + 2px); - font-family: 'JD'; + font-family: 'JD', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;src/styles/theme-default.scss (1)
36-36
: 新增特殊禁用状态颜色变量添加了新的颜色变量
--nutui-color-primary-specialdisabled
和--nutui-red-3
,这些变量增强了组件在特殊禁用状态下的视觉反馈。建议添加相关文档说明这些新变量的具体使用场景。建议在代码注释中添加这些变量的使用说明:
+ // 用于特殊禁用状态下的主要颜色,例如倒计时组件中的特殊禁用状态 --nutui-color-primary-specialdisabled: var(--nutui-red-3); + // 用于轻量级的红色背景或边框 --nutui-red-3: #ffadbe;Also applies to: 67-67
src/styles/theme-dark.scss (1)
37-37
: 新增的颜色变量定义正确且位置恰当!新增的两个颜色变量
--nutui-color-primary-specialdisabled
和--nutui-red-3
遵循了命名规范,并且与现有的颜色系统保持一致。建议在变量定义处添加注释,说明这些颜色变量的具体用途,例如:
- --nutui-color-primary-specialdisabled: var(--nutui-red-3); + // 特殊禁用状态下的主要颜色 + --nutui-color-primary-specialdisabled: var(--nutui-red-3); - --nutui-red-3: #ffadbe; + // 红色色阶 - 级别3 + --nutui-red-3: #ffadbe;Also applies to: 69-69
src/styles/variables.scss (1)
23-26
: 新增的SCSS变量定义正确!新增的
$color-primary-specialdisabled
变量定义合理,并提供了默认值作为降级方案。建议添加变量说明注释:
+// 特殊禁用状态下的主要颜色 $color-primary-specialdisabled: var( --nutui-color-primary-specialdisabled, #ffadbe ) !default;
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
📒 Files selected for processing (5)
src/packages/countdown/countdown.scss
(1 hunks)src/packages/countdown/countdown.taro.tsx
(1 hunks)src/styles/theme-dark.scss
(2 hunks)src/styles/theme-default.scss
(2 hunks)src/styles/variables.scss
(2 hunks)
🔇 Additional comments (3)
src/packages/countdown/countdown.scss (1)
29-38
: 使用伪元素优化边框实现方式
使用 ::after 伪元素和 transform: scale(0.5) 来实现细边框是一个好的实践,可以在高分辨率屏幕上呈现更清晰的边框。
src/packages/countdown/countdown.taro.tsx (1)
284-284
: 优化了天数显示逻辑
通过添加 unit !== 'DD'
条件,确保天数显示不会被 padZero 函数处理,这是一个合理的改进。
src/styles/variables.scss (1)
810-810
: 倒计时组件边框颜色更新需要验证视觉效果
$countdown-number-border-color
已更新为使用新的特殊禁用状态颜色。
请确认倒计时组件在各个状态下的视觉表现是否符合预期。建议:
- 检查默认状态的边框显示
- 验证禁用状态下的边框颜色
- 确保与其他组件的视觉风格保持一致
🤔 这个变动的性质是?
🔗 相关 Issue
💡 需求背景和解决方案
☑️ 请求合并前的自查清单
Summary by CodeRabbit
新特性
Bug 修复
文档