-
Notifications
You must be signed in to change notification settings - Fork 324
fix(alert): move close icon to center #2856
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
WalkthroughThis pull request refines the styling of the alert component by updating the CSS selector for the alert icon. The selector now excludes elements with the "close" class by applying the Changes
Possibly related PRs
Suggested labels
Suggested reviewers
Poem
Tip 🌐 Web search-backed reviews and chat
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 (
|
Walkthrough此PR修复了Alert组件中关闭按钮偏下的问题,通过调整样式使关闭按钮居中。主要修改了样式文件以确保关闭按钮不受其他图标样式的影响。 Changes
|
@@ -32,7 +32,7 @@ | |||
} | |||
|
|||
/** alert-icon 场景 */ | |||
.@{alert-prefix-cls}__icon { | |||
.@{alert-prefix-cls}__icon:not(.@{alert-prefix-cls}__close) { |
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.
确保选择器的更改不会影响其他图标的样式。此更改将关闭按钮从其他图标样式中排除,确保其居中显示。
WalkthroughThis PR fixes the problem of down-down button in the Alert component, centering the close button by adjusting the style. The style file is mainly modified to ensure that the close button is not affected by other icon styles. Changes| File | Summary | |
[e2e-test-warn] The title of the Pull request should look like "fix(vue-renderless): [action-menu, alert] fix xxx bug". Please make sure you've read our contributing guide |
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 (1)
packages/theme/src/alert/index.less (1)
35-40
: CSS Selector Refinement for Alert IconThe updated selector
.@{alert-prefix-cls}__icon:not(.@{alert-prefix-cls}__close)
ensures that the styling (including the
margin-top: 2px;
) is applied only to the alert icon and not to the close icon. This change appropriately targets the non-close icons and should correct the misalignment issue of the close button by allowing its dedicated styling (defined later) to take full effect.To further enhance maintainability, consider verifying that the individually defined properties for the close icon (from lines 68 onward) are sufficient for centering it in all alert contexts, especially when combined with modifiers like
.is-center
.
PR
修复Alert组件的关闭按钮偏下的问题
PR Checklist
Please check if your PR fulfills the following requirements:
PR Type
What kind of change does this PR introduce?
What is the current behavior?
Issue Number: N/A
What is the new behavior?
Does this PR introduce a breaking change?
Other information
Summary by CodeRabbit