提示helpTip的标准化

This commit is contained in:
CakeCN
2025-12-12 16:58:27 +08:00
parent 41c17fcde1
commit ac74c28f64
5 changed files with 218 additions and 31 deletions

View File

@@ -0,0 +1,51 @@
/* HelpTip 组件样式 */
/* 问号图标样式 */
.help-icon {
display: inline-block;
margin-left: 8px;
color: #888;
font-weight: bold;
cursor: help;
font-size: 14px;
line-height: 1;
transition: color 0.2s ease;
}
.help-icon:hover {
color: #4CAF50;
}
/* 全局提示框样式(挂在 body 下) */
.tooltip-portal {
position: fixed; /* 不受父级 overflow 影响 */
left: 0;
top: 0;
z-index: 999999; /* 足够高,覆盖所有元素 */
display: none;
opacity: 0;
transition: opacity 0.08s linear;
background: rgba(0, 0, 0, 0.9);
color: #fff;
padding: 6px 10px;
border-radius: 6px;
font-size: 13px;
line-height: 1.4;
pointer-events: none; /* 鼠标穿透,避免闪烁 */
white-space: pre-wrap; /* 支持换行符 */
max-width: 300px;
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
word-wrap: break-word;
}
/* 提示框显示状态 */
.tooltip-portal.show {
display: block;
opacity: 1;
}
/* 提示框动画效果 */
.tooltip-portal.fade {
transition: opacity 0.2s ease;
}

View File

@@ -1,34 +1,3 @@
/* 问号图标 */
.help-icon {
display: inline-block;
margin-left: 8px;
color: #888;
font-weight: bold;
cursor: help;
}
.help-icon:hover { color: #4CAF50; }
/* Portal Tooltip挂在 body 下) */
.tooltip-portal {
position: fixed; /* 不受父级 overflow 影响 */
left: 0; top: 0;
z-index: 999999; /* 足够高,覆盖侧栏等 */
display: none;
opacity: 0;
transition: opacity .08s linear;
background: rgba(0,0,0,.9);
color: #fff;
padding: 6px 10px;
border-radius: 6px;
font-size: 13px;
line-height: 1.4;
pointer-events: none; /* 鼠标穿透,避免闪烁 */
white-space: nowrap;
box-shadow: 0 4px 12px rgba(0,0,0,.25);
}
.add-step-btn, .add-phase-btn {
background-color: #4CAF50;