Skip to content

fix: 将calendar中icon的样式内置到scss#3448

Merged
xiyehutao merged 1 commit intojdf2e:feat_v3.x_cpp_orderfrom
xiyehutao:fix_calendar_arrowIcon
Apr 30, 2026
Merged

fix: 将calendar中icon的样式内置到scss#3448
xiyehutao merged 1 commit intojdf2e:feat_v3.x_cpp_orderfrom
xiyehutao:fix_calendar_arrowIcon

Conversation

@xiyehutao
Copy link
Copy Markdown
Collaborator

@xiyehutao xiyehutao commented Apr 30, 2026

🤔 这个变动的性质是?

  • [✅] 日常 bug 修复

⚠️ 请自检并全部勾选全部选项⚠️

  • [✅] 文档已补充或无须补充
  • [✅] 代码演示已提供或无须提供
  • [✅] TypeScript 定义已补充或无须补充
  • [✅] fork仓库代码是否为最新避免文件冲突
  • [✅] Files changed 没有 package.json lock 等无关文件

Summary by CodeRabbit

发布说明

  • 样式优化
    • 改进了日历卡片组件图标的样式处理方式。

@github-actions github-actions Bot added the action:review This PR needs more reviews (less than 2 approvals) label Apr 30, 2026
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Apr 30, 2026

工作总结

本次提交对日历卡片组件的图标样式进行了重构,将内联尺寸属性迁移至 CSS 类管理,使用 nut-calendarcard-icon 类来控制 18×18 的固定尺寸和块级显示。

变更详情

群组 / 文件 总结
日历卡片图标样式
src/packages/calendarcard/calendarcard.scss
添加 &-icon 选择器,为图标元素设置固定的 18×18 尺寸和块级显示属性。
图标组件渲染逻辑
src/packages/calendarcard/icon.taro.tsx
Image 组件移除内联的宽高属性,转而通过新增的 nut-calendarcard-icon CSS 类进行尺寸控制,简化组件代码。

代码审查工作量估计

🎯 2 (简单) | ⏱️ ~10 分钟

可能相关的 PR

建议的审查者

  • xiaoyatong

兔子的诗

📅✨ 图标离开内联的家,
投入 CSS 类的怀抱,
十八乘十八,完美方形,
样式整洁,代码优雅,
日历卡片焕然一新~ 🎨

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share
Review rate limit: 7/8 reviews remaining, refill in 7 minutes and 30 seconds.

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@src/packages/calendarcard/calendarcard.scss`:
- Around line 33-37: 当前 RTL 规则只覆盖 svg/.nut-icon-*,但新增的样式类 nut-calendarcard-icon
及其 Image 子元素未被包含,导致在 RTL 环境下箭头图片不翻转;请在 RTL CSS 规则中将 .nut-calendarcard-icon(及其
img 或 Taro Image 的选择器)加入现有的 RTL 翻转选择器(与 .nut-icon-* 一并),确保在 [dir="rtl"] 或 .rtl
父选择器下对该类使用相同的翻转 transform(例如水平翻转/旋转)以修复左右含义错误,并保持与现有 svg 翻转规则一致。
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: d421e7ee-a11d-4ef1-9536-bc67bbf157cb

📥 Commits

Reviewing files that changed from the base of the PR and between c37d280 and 2c68438.

📒 Files selected for processing (2)
  • src/packages/calendarcard/calendarcard.scss
  • src/packages/calendarcard/icon.taro.tsx

Comment on lines +33 to +37
&-icon {
width: 18px;
height: 18px;
display: block;
}
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major | ⚡ Quick win

补齐 RTL 下图片箭头的翻转规则

Line 33 新增了 nut-calendarcard-icon,但 RTL 旋转规则仍只覆盖 svg/.nut-icon-*。Taro 的 Image 箭头在 RTL 下会保持 LTR 方向,导致左右含义显示错误。

建议修改
 [dir='rtl'] .nut-calendarcard,
 .nut-rtl .nut-calendarcard {
   &-header {
     &-left,
     &-right {
       .left {
         margin-left: 0;
         margin-right: 8px;
       }

       .right {
         margin-right: 0;
         margin-left: 8px;
       }

       .nut-icon-ArrowLeft,
       .nut-icon-ArrowRight,
+      .nut-calendarcard-icon,
       svg {
         transform: rotate(180deg);
       }
     }
   }
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
&-icon {
width: 18px;
height: 18px;
display: block;
}
[dir='rtl'] .nut-calendarcard,
.nut-rtl .nut-calendarcard {
&-header {
&-left,
&-right {
.left {
margin-left: 0;
margin-right: 8px;
}
.right {
margin-right: 0;
margin-left: 8px;
}
.nut-icon-ArrowLeft,
.nut-icon-ArrowRight,
.nut-calendarcard-icon,
svg {
transform: rotate(180deg);
}
}
}
}
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/packages/calendarcard/calendarcard.scss` around lines 33 - 37, 当前 RTL
规则只覆盖 svg/.nut-icon-*,但新增的样式类 nut-calendarcard-icon 及其 Image 子元素未被包含,导致在 RTL
环境下箭头图片不翻转;请在 RTL CSS 规则中将 .nut-calendarcard-icon(及其 img 或 Taro Image 的选择器)加入现有的
RTL 翻转选择器(与 .nut-icon-* 一并),确保在 [dir="rtl"] 或 .rtl 父选择器下对该类使用相同的翻转
transform(例如水平翻转/旋转)以修复左右含义错误,并保持与现有 svg 翻转规则一致。

@xiyehutao xiyehutao merged commit c58fe8b into jdf2e:feat_v3.x_cpp_order Apr 30, 2026
4 of 5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

action:review This PR needs more reviews (less than 2 approvals) size/S

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant