fix: tooltip 浅色模式不可见 - 覆盖 Element Plus CSS 变量
根因: .el-popper 全局规则覆盖了 tooltip 背景为浅色, 但 is-dark 类 仍将文字设为白色。现在同时覆盖 --el-text-color-primary 和 --el-bg-color 变量, 确保 tooltip 背景和文字都有对比度。
This commit is contained in:
@@ -193,28 +193,21 @@ body {
|
|||||||
background-color: var(--accent) !important;
|
background-color: var(--accent) !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Tooltip */
|
/* Tooltip - override Element Plus CSS variables + direct properties */
|
||||||
.el-tooltip__popper.is-dark {
|
.el-tooltip__popper {
|
||||||
|
--el-tooltip-bg-color: var(--bg-tertiary);
|
||||||
|
--el-tooltip-text-color: var(--text-primary);
|
||||||
|
--el-text-color-primary: var(--bg-tertiary);
|
||||||
|
--el-bg-color: var(--text-primary);
|
||||||
background: var(--bg-tertiary) !important;
|
background: var(--bg-tertiary) !important;
|
||||||
color: var(--text-primary) !important;
|
color: var(--text-primary) !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
.el-tooltip__popper.is-dark .el-popper__arrow::before {
|
.el-tooltip__popper .el-popper__arrow::before {
|
||||||
background: var(--bg-tertiary) !important;
|
background: var(--bg-tertiary) !important;
|
||||||
border-color: var(--border-color) !important;
|
border-color: var(--border-color) !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
.el-tooltip__popper.is-light {
|
|
||||||
background: var(--bg-secondary) !important;
|
|
||||||
color: var(--text-primary) !important;
|
|
||||||
border-color: var(--border-color) !important;
|
|
||||||
}
|
|
||||||
|
|
||||||
.el-tooltip__popper.is-light .el-popper__arrow::before {
|
|
||||||
background: var(--bg-secondary) !important;
|
|
||||||
border-color: var(--border-color) !important;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Message */
|
/* Message */
|
||||||
.el-message {
|
.el-message {
|
||||||
background: var(--bg-secondary) !important;
|
background: var(--bg-secondary) !important;
|
||||||
|
|||||||
Reference in New Issue
Block a user