-
Notifications
You must be signed in to change notification settings - Fork 267
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
feat(popover): 增加最大宽度设置,支持文本超过最大宽度时,换行展示。 #2851
base: next
Are you sure you want to change the base?
Conversation
Walkthrough此次更改引入了新的 CSS 变量 Changes
Possibly related PRs
Suggested labels
Suggested reviewers
📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
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 @@
## next #2851 +/- ##
=======================================
Coverage 84.01% 84.02%
=======================================
Files 219 220 +1
Lines 17899 17907 +8
Branches 2622 2625 +3
=======================================
+ Hits 15038 15046 +8
Misses 2856 2856
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: 1
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
📒 Files selected for processing (6)
src/packages/popover/doc.en-US.md
(1 hunks)src/packages/popover/doc.md
(1 hunks)src/packages/popover/doc.taro.md
(1 hunks)src/packages/popover/doc.zh-TW.md
(1 hunks)src/packages/popover/popover.scss
(1 hunks)src/styles/variables.scss
(1 hunks)
✅ Files skipped from review due to trivial changes (1)
- src/packages/popover/doc.en-US.md
🔇 Additional comments (4)
src/packages/popover/doc.taro.md (1)
161-161
: 新增的 CSS 变量定义清晰且实用!
新增的 --nutui-popover-menu-item-width
变量很好地解决了长文本展示的问题,默认值 160px 也符合常见的 UI 设计规范。
src/packages/popover/doc.md (1)
170-170
: 新增的 CSS 变量定义清晰且实用!
新增的 --nutui-popover-menu-item-width
变量很好地解决了长文本展示的问题,默认值 160px 也符合常见的 UI 设计规范。
src/packages/popover/popover.scss (1)
98-99
: 样式变更正确且符合需求!
新增的样式属性可以有效控制菜单项的最大宽度,并在文本超出时自动换行,实现了预期功能。
src/styles/variables.scss (1)
1556-1556
: 变量定义合理且具有灵活性!
新增的变量 $popover-menu-item-width
具有以下优点:
- 遵循了项目的命名规范
- 提供了合理的默认值 160px
- 通过 CSS 变量支持运行时自定义
- 使用 !default 标记允许外部覆盖
src/packages/popover/doc.zh-TW.md
Outdated
@@ -167,3 +167,4 @@ PopoverList 屬性是一個由對象構成的數組,數組中的每個對象 | |||
| \--nutui-popover-divider-color | 選項區的底部 border 顏色 | `$color-border` | | |||
| \--nutui-popover-disable-color | 選項禁用的顏色 | `$color-text-disabled` | | |||
| \--nutui-popover-menu-item-padding | 選項區菜單每一項的 padding 值 | `8px` | | |||
| \--nutui-popover-menu-item-width | 選項區菜單每一項宽度值,超过宽度值后,会折行展示,保障信息的完整性 | `160px` | |
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.
请将说明文字翻译为繁体中文!
新增的 CSS 变量说明仍使用简体中文,需要翻译为繁体中文以保持文档的语言一致性。建议修改为:
-| \--nutui-popover-menu-item-width | 選項區菜單每一項宽度值,超过宽度值后,会折行展示,保障信息的完整性 | `160px` |
+| \--nutui-popover-menu-item-width | 選項區菜單每一項寬度值,超過寬度值後,會折行展示,保障信息的完整性 | `160px` |
📝 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.
| \--nutui-popover-menu-item-width | 選項區菜單每一項宽度值,超过宽度值后,会折行展示,保障信息的完整性 | `160px` | | |
| \--nutui-popover-menu-item-width | 選項區菜單每一項寬度值,超過寬度值後,會折行展示,保障信息的完整性 | `160px` | |
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.
🤔 这个变动的性质是?
🔗 相关 Issue
💡 需求背景和解决方案
☑️ 请求合并前的自查清单
Summary by CodeRabbit
新特性
--nutui-popover-menu-item-width
,用于自定义 Popover 组件菜单项的宽度。文档更新
样式改进
.nut-popover-menu-item
类中添加了max-width
和word-wrap
属性,以改善菜单项的布局和可读性。.nut-popover-menu-item-name
类的宽度和弹性属性。变量更新
$popover-menu-item-width
,用于设置 Popover 菜单项的默认宽度。