修改框架tab页标签样式

This commit is contained in:
tangw 2025-11-07 15:48:04 +08:00
parent c2bf4656eb
commit 5cd1b0d887

View File

@ -243,35 +243,63 @@ function handleScroll() {
<style lang='scss' scoped>
.tags-view-container {
height: 34px;
height: 34px; /* 稍微增加高度,让立体效果更明显 */
width: 100%;
background: #fff;
border-bottom: 1px solid #d8dce5;
box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.12), 0 0 3px 0 rgba(0, 0, 0, 0.04);
background: #f5f7fa; /* 标签栏整体背景(浅灰,与标签区分) */
/* 1. 去掉底部边框(关键:消除物理边框导致的缝隙) */
border-bottom: none;
/* 2. 弱化或去掉标签栏的底部阴影(避免阴影造成视觉缝隙) */
box-shadow: 0 1px 2px rgba(0, 0, 0, 0.02); /* 仅保留极浅的顶部阴影 */
/* 标签栏底部加一条浅线,区分标签栏和下方页面 */
border-bottom: 1px solid #e0e0e0;
.tags-view-wrapper {
.tags-view-item {
display: inline-block;
position: relative;
cursor: pointer;
height: 26px;
line-height: 26px;
border: 1px solid #d8dce5;
color: #495060;
background: #fff;
padding: 0 8px;
font-size: 12px;
margin-left: 5px;
margin-top: 4px;
&:first-of-type {
margin-left: 15px;
}
&:last-of-type {
margin-right: 15px;
}
/* 未激活标签:灰色渐变+立体阴影 */
display: inline-block;
position: relative;
cursor: pointer;
height: 28px;
line-height: 28px;
padding: 0 12px;
font-size: 12px;
margin-left: 4px;
margin-top: 4px;
border-radius: 4px 4px 0 0; /* 底部圆角去掉,与下方无缝感 */
border: 1px solid #d0d0d0; /* 浅灰边框 */
border-bottom-color: transparent; /* 底部边框透明,避免与标签栏线重叠 */
/* 灰色渐变:从上到下浅灰→深灰(模拟轻微凸起) */
background: linear-gradient(180deg, #f0f0f0 0%, #e0e0e0 100%);
/* 立体阴影:底部轻微阴影+顶部内高光 */
box-shadow:
0 2px 4px rgba(0, 0, 0, 0.1), /* 底部阴影加深,突出悬浮感 */
inset 0 1px 1px rgba(255, 255, 255, 0.8); /* 顶部内高光,增强凸起感 */
color: #777; /* 文字灰色,不抢眼 */
transition: all 0.2s ease; /* 过渡动画 */
/* 鼠标悬停时增强效果(未激活状态) */
&:hover:not(.active) {
background: linear-gradient(180deg, #f5f5f5 0%, #e8e8e8 100%);
box-shadow:
0 3px 4px rgba(0, 0, 0, 0.08),
inset 0 1px 0 rgba(255, 255, 255, 0.9);
border-color: #d0d0d0;
color: #333; /* hover时文字略深 */
}
/* 激活标签样式:深色渐变+强阴影,突出当前页 */
&.active {
background-color: #42b983;
color: #fff;
border-color: #42b983;
/* 激活标签:从左到右的主题色渐变(示例用蓝紫色) */
background: linear-gradient(90deg, #409eff 0%, #6b7aff 100%);
color: #ffffff; /* 文字白色,与渐变背景对比 */
border-color: #409eff; /* 边框与渐变颜色匹配 */
box-shadow: 0 3px 6px rgba(64, 158, 255, 0.25), /* 外阴影(带颜色倾向,增强立体感) */
inset 0 1px 0 rgba(255, 255, 255, 0.2); /* 内阴影(顶部亮边,模拟高光) */
transform: translateY(-1px); /* 轻微上浮,与其他标签区分 */
&::before {
content: "";
background: #fff;
@ -281,28 +309,34 @@ function handleScroll() {
border-radius: 50%;
position: relative;
margin-right: 5px;
box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1); /* 小圆圈阴影,增强立体 */
}
}
}
}
/* 右键菜单也增加立体效果 */
.contextmenu {
margin: 0;
background: #fff;
background: linear-gradient(180deg, #ffffff 0%, #f9fafb 100%);
z-index: 3000;
position: absolute;
list-style-type: none;
padding: 5px 0;
border-radius: 4px;
border-radius: 6px;
font-size: 12px;
font-weight: 400;
color: #333;
box-shadow: 2px 2px 3px 0 rgba(0, 0, 0, 0.3);
box-shadow: 0 3px 10px rgba(0, 0, 0, 0.15), /* 外阴影 */
inset 0 1px 0 rgba(255, 255, 255, 0.8); /* 内阴影 */
border: 1px solid #e5e7eb;
li {
margin: 0;
padding: 7px 16px;
cursor: pointer;
&:hover {
background: #eee;
background: #f0f5ff; /* hover 时浅蓝色背景,与整体风格呼应 */
}
}
}