-
Notifications
You must be signed in to change notification settings - Fork 3
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
缓解Infobox可能出现的宽度溢出 #43
Conversation
When an element with margin or padding is given length of 100%, it will overflow its parent if it uses content-box.
Walkthrough此次更改主要集中在 Changes
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 (
|
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 (1)
src/SiteCommon/modules/infobox.less (1)
Line range hint
4-18
: 建议优化选择器特异性以减少 !important 的使用当前实现中多处使用了
!important
,这可能表明存在选择器特异性问题。建议考虑以下优化方向:
- 重新评估选择器结构,提高特异性以避免使用
!important
- 考虑使用 CSS 自定义属性(变量)来统一管理关键样式值
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
⛔ Files ignored due to path filters (1)
dist/SiteCommon/SiteCommon.css
is excluded by!**/dist/**
📒 Files selected for processing (1)
src/SiteCommon/modules/infobox.less
(1 hunks)
🔇 Additional comments (1)
src/SiteCommon/modules/infobox.less (1)
55-55
: 添加 box-sizing 属性来解决宽度溢出问题
这个改动通过确保 padding 和 border 包含在宽度计算中来防止溢出,是一个合理的解决方案。
建议执行以下测试脚本来验证不同内容场景下的布局效果:
也许Infobox这坨换回
display: table
更好,,Summary by CodeRabbit
td:only-child
和th:only-child
选择器添加了box-sizing: border-box;
属性,以改善表格单元格的布局控制。