fix(dialog): restrict header icon style to direct children#2203
Open
baozjj wants to merge 1 commit intoTencent:developfrom
Open
fix(dialog): restrict header icon style to direct children#2203baozjj wants to merge 1 commit intoTencent:developfrom
baozjj wants to merge 1 commit intoTencent:developfrom
Conversation
Contributor
Author
|
这样子改好像也不太妥当,会对之前的代码效果产生影响,有更好的方案嘛🤔 |
Collaborator
是个 tradeoff 的问题 之前的效果可能会对demo的场景更方便 但是范围过大污染了其他场景,改动后要实现demo的场景又需要增加额外的代码 |
Contributor
Author
确实,但这是一个值得优化的问题,目前只能通过这种方式避免:
设置
个人信息
.....
.dialog-header-patch ::v-deep(.t-icon) {
font-size: inherit;
}
|
Contributor
Author
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

🤔 这个 PR 的性质是?
🔗 相关 Issue
N/A(样式问题,未记录 Issue,可视为内部样式修复)
💡 需求背景和解决方案
当前
<t-dialog>的.t-dialog__header中,样式选择器:作用范围过大,会影响
header插槽中用户自定义组件(如<t-breadcrumb>、<t-button>)内的.t-icon,造成图标尺寸和样式异常。✅ 修改方案
将选择器修改为仅匹配 直系子元素:
🎯 修改效果
.t-dialog__header中深层.t-icon被放大的副作用(少见),此改动会使其恢复正常。效果截图对比(前 / 后)
❌ 修改前(嵌套组件 icon 被误伤)
✅ 修改后(嵌套组件样式恢复正常)
✅ header 中直系 icon 样式仍保留(视觉不变)
📝 更新日志
fix(dialog): 限制 header icon 样式为直系子元素,避免误伤插槽嵌套组件的图标
本条 PR 不需要纳入 Changelog
☑️ 请求合并前的自查清单