refactor: Simplify UI styles and remove unused theme management

- Removed theme initialization and management from the UI store.
- Cleaned up CSS styles across multiple components, replacing CSS variables with fixed color values for consistency.
- Updated background colors and text colors to enhance UI clarity and responsiveness.
- Streamlined component styles to improve maintainability and readability.
This commit is contained in:
wizardchen
2025-11-06 02:47:01 +08:00
parent 7a64371603
commit 602e8a3b88
23 changed files with 329 additions and 508 deletions
+27 -27
View File
@@ -219,24 +219,24 @@ const getImgSrc = (url: string) => {
max-height: 250px !important;
min-height: 112px !important;
resize: none;
color: var(--td-text-color-primary);
color: #000000e6;
font-size: 16px;
font-weight: 400;
line-height: 24px;
font-family: "PingFang SC";
padding: 16px 12px 52px 16px; /* 增加底部padding为控制栏腾出空间 */
border-radius: 12px;
border: 1px solid var(--td-component-border);
border: 1px solid #E7E7E7;
box-sizing: border-box;
background: var(--td-bg-color-container);
box-shadow: var(--td-shadow-1);
background: #FFF;
box-shadow: 0 6px 6px 0 #0000000a, 0 12px 12px -1px #00000014;
&:focus {
border: 1px solid var(--td-brand-color);
border: 1px solid #07C05F;
}
&::placeholder {
color: var(--td-text-color-placeholder);
color: #00000066;
font-family: "PingFang SC";
font-size: 16px;
font-weight: 400;
@@ -271,14 +271,14 @@ const getImgSrc = (url: string) => {
gap: 4px;
padding: 6px 10px;
border-radius: 6px;
background: var(--td-bg-color-component);
background: #f5f5f5;
cursor: pointer;
transition: all 0.2s ease;
user-select: none;
flex-shrink: 0;
&:hover {
background: var(--td-bg-color-component-hover);
background: #e6e6e6;
transform: scale(1.02);
}
@@ -291,7 +291,7 @@ const getImgSrc = (url: string) => {
cursor: not-allowed;
&:hover {
background: var(--td-bg-color-component);
background: #f5f5f5;
transform: none;
}
}
@@ -303,10 +303,10 @@ const getImgSrc = (url: string) => {
padding: 0;
&.active {
background: var(--td-brand-color-light);
background: rgba(7, 192, 95, 0.1);
&:hover {
background: var(--td-brand-color-focus);
background: rgba(7, 192, 95, 0.15);
}
}
}
@@ -323,24 +323,24 @@ const getImgSrc = (url: string) => {
min-width: auto;
&.active {
background: var(--td-brand-color-light);
color: var(--td-brand-color);
background: rgba(7, 192, 95, 0.1);
color: #07C05F;
&:hover {
background: var(--td-brand-color-focus);
background: rgba(7, 192, 95, 0.15);
}
}
}
.kb-btn-text {
font-size: 13px;
color: var(--td-text-color-secondary);
color: #666;
font-weight: 500;
white-space: nowrap;
}
.kb-btn.active .kb-btn-text {
color: var(--td-brand-color);
color: #07C05F;
}
.dropdown-arrow {
@@ -372,16 +372,16 @@ const getImgSrc = (url: string) => {
align-items: center;
gap: 4px;
padding: 4px 8px;
background: var(--td-brand-color-light);
border: 1px solid var(--td-brand-color-3);
background: rgba(7, 192, 95, 0.1);
border: 1px solid rgba(7, 192, 95, 0.3);
border-radius: 4px;
font-size: 12px;
color: var(--td-brand-color);
color: #07C05F;
white-space: nowrap;
transition: all 0.15s ease;
&:hover {
background: var(--td-brand-color-focus);
background: rgba(7, 192, 95, 0.15);
}
}
@@ -404,12 +404,12 @@ const getImgSrc = (url: string) => {
}
.more-tag {
background: var(--td-bg-color-component);
border-color: var(--td-component-border);
color: var(--td-text-color-secondary);
background: rgba(0, 0, 0, 0.05);
border-color: rgba(0, 0, 0, 0.1);
color: #666;
&:hover {
background: var(--td-bg-color-component-hover);
background: rgba(0, 0, 0, 0.08);
}
}
@@ -417,15 +417,15 @@ const getImgSrc = (url: string) => {
width: 28px;
height: 28px;
padding: 0;
background-color: var(--td-brand-color);
background-color: #07C05F;
&:hover:not(.disabled) {
background-color: var(--td-brand-color-hover);
background-color: #00a651;
transform: scale(1.05);
}
&.disabled {
background-color: var(--td-brand-color-disabled);
background-color: #b5eccf;
}
img {
+16 -16
View File
@@ -161,7 +161,7 @@ onUnmounted(() => {
background: transparent;
&:hover {
background: var(--td-bg-color-component-hover);
background: #f5f7fa;
}
&:active {
@@ -175,7 +175,7 @@ onUnmounted(() => {
border-radius: 50%;
overflow: hidden;
flex-shrink: 0;
background: linear-gradient(135deg, var(--td-brand-color) 0%, var(--td-brand-color-active) 100%);
background: linear-gradient(135deg, #07C05F 0%, #05A34E 100%);
display: flex;
align-items: center;
justify-content: center;
@@ -187,7 +187,7 @@ onUnmounted(() => {
}
.avatar-placeholder {
color: var(--td-text-color-anti);
color: #ffffff;
font-size: 16px;
font-weight: 600;
}
@@ -201,7 +201,7 @@ onUnmounted(() => {
.user-name {
font-size: 14px;
font-weight: 500;
color: var(--td-text-color-primary);
color: #333333;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
@@ -209,7 +209,7 @@ onUnmounted(() => {
.user-email {
font-size: 12px;
color: var(--td-text-color-secondary);
color: #666666;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
@@ -218,7 +218,7 @@ onUnmounted(() => {
.dropdown-icon {
font-size: 16px;
color: var(--td-text-color-secondary);
color: #666666;
flex-shrink: 0;
transition: transform 0.2s;
}
@@ -229,10 +229,10 @@ onUnmounted(() => {
left: 8px;
right: 8px;
margin-bottom: 8px;
background: var(--td-bg-color-container);
background: #ffffff;
border-radius: 8px;
box-shadow: var(--td-shadow-2);
border: 1px solid var(--td-component-border);
box-shadow: 0 4px 20px rgba(0, 0, 0, 0.12);
border: 1px solid #e5e7eb;
overflow: hidden;
z-index: 1000;
}
@@ -245,33 +245,33 @@ onUnmounted(() => {
cursor: pointer;
transition: all 0.2s;
font-size: 14px;
color: var(--td-text-color-primary);
color: #333333;
&:hover {
background: var(--td-bg-color-component-hover);
background: #f5f7fa;
}
&.danger {
color: var(--td-error-color);
color: #e34d59;
&:hover {
background: var(--td-error-color-light);
background: #fef0f0;
}
.menu-icon {
color: var(--td-error-color);
color: #e34d59;
}
}
.menu-icon {
font-size: 16px;
color: var(--td-text-color-secondary);
color: #666666;
}
}
.menu-divider {
height: 1px;
background: var(--td-component-border);
background: #e5e7eb;
margin: 4px 0;
}
+52 -61
View File
@@ -554,14 +554,14 @@ watch(() => route.params.kbId, () => {
</script>
<style lang="less" scoped>
.del_submenu {
color: var(--td-error-color);
color: #fa5151;
cursor: pointer;
}
.aside_box {
min-width: 260px;
padding: 8px;
background: var(--td-bg-color-container);
background: #fff;
box-sizing: border-box;
height: 100vh;
overflow: hidden;
@@ -585,19 +585,10 @@ watch(() => route.params.kbId, () => {
height: 30px;
margin-right: 7.25px;
}
/* 暗色模式下的Logo滤镜 */
:root[theme-mode="dark"] .logo {
filter: brightness(0) invert(1);
}
:root[theme-mode="dark"] .logo_img {
filter: brightness(0) invert(1);
}
.logo_txt {
transform: rotate(0.049deg);
color: var(--td-text-color-primary);
color: #000000;
font-family: "TencentSans";
font-size: 24.12px;
font-style: normal;
@@ -639,28 +630,28 @@ watch(() => route.params.kbId, () => {
}
.upload-file-wrap:hover {
background-color: var(--td-brand-color-light);
color: var(--td-brand-color);
background-color: #dbede4;
color: #07C05F;
}
.upload-file-icon {
width: 20px;
height: 20px;
color: var(--td-text-color-secondary);
color: rgba(0, 0, 0, 0.6);
}
.active-upload {
color: var(--td-brand-color);
color: #07C05F;
}
.menu_item_active {
border-radius: 4px;
background: var(--td-brand-color-light) !important;
background: #07c05f1a !important;
.menu_icon,
.menu_title {
color: var(--td-brand-color) !important;
color: #07c05f !important;
}
}
@@ -668,7 +659,7 @@ watch(() => route.params.kbId, () => {
.menu_icon,
.menu_title {
color: var(--td-text-color-primary);
color: #000000e6;
}
}
@@ -695,12 +686,12 @@ watch(() => route.params.kbId, () => {
&:hover {
border-radius: 4px;
background: var(--td-bg-color-container-hover);
color: var(--td-text-color-secondary);
background: #30323605;
color: #00000099;
.menu_icon,
.menu_title {
color: var(--td-text-color-secondary);
color: #00000099;
}
}
}
@@ -708,7 +699,7 @@ watch(() => route.params.kbId, () => {
.menu_icon {
display: flex;
margin-right: 10px;
color: var(--td-text-color-secondary);
color: #00000099;
.icon {
width: 20px;
@@ -719,7 +710,7 @@ watch(() => route.params.kbId, () => {
}
.menu_title {
color: var(--td-text-color-secondary);
color: #00000099;
text-overflow: ellipsis;
font-family: "PingFang SC";
font-size: 14px;
@@ -754,7 +745,7 @@ watch(() => route.params.kbId, () => {
cursor: pointer;
display: flex;
align-items: center;
color: var(--td-text-color-secondary);
color: #00000099;
font-weight: 400;
line-height: 22px;
height: 36px;
@@ -775,14 +766,14 @@ watch(() => route.params.kbId, () => {
.menu-more {
display: inline-block;
font-weight: bold;
color: var(--td-brand-color);
color: #07C05F;
}
.dot {
width: 4px;
height: 4px;
border-radius: 50%;
background: var(--td-brand-color);
background: #07C05F;
}
.sub_title {
@@ -790,12 +781,12 @@ watch(() => route.params.kbId, () => {
}
&:hover {
background: var(--td-bg-color-container-hover);
color: var(--td-text-color-secondary);
background: #30323605;
color: #00000099;
border-radius: 3px;
.menu-more {
color: var(--td-text-color-secondary);
color: #00000099;
}
.submenu_title {
@@ -806,12 +797,12 @@ watch(() => route.params.kbId, () => {
}
.submenu_item_active {
background: var(--td-brand-color-light) !important;
color: var(--td-brand-color) !important;
background: #07c05f1a !important;
color: #07c05f !important;
border-radius: 3px;
.menu-more {
color: var(--td-brand-color) !important;
color: #07c05f !important;
}
}
}
@@ -819,7 +810,7 @@ watch(() => route.params.kbId, () => {
/* 知识库下拉菜单样式 */
.kb-dropdown-icon {
margin-left: auto;
color: var(--td-text-color-secondary);
color: #666;
transition: transform 0.3s ease, color 0.2s ease;
cursor: pointer;
display: flex;
@@ -833,15 +824,15 @@ watch(() => route.params.kbId, () => {
}
&:hover {
color: var(--td-brand-color);
color: #07c05f;
}
&.active {
color: var(--td-brand-color);
color: #07c05f;
}
&.active:hover {
color: var(--td-brand-color-hover);
color: #05a04f;
}
svg {
@@ -856,10 +847,10 @@ watch(() => route.params.kbId, () => {
top: 100%;
left: 0;
right: 0;
background: var(--td-bg-color-container);
border: 1px solid var(--td-component-border);
background: #fff;
border: 1px solid #e5e7eb;
border-radius: 6px;
box-shadow: var(--td-shadow-2);
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
z-index: 1000;
max-height: 200px;
overflow-y: auto;
@@ -870,15 +861,15 @@ watch(() => route.params.kbId, () => {
cursor: pointer;
transition: background-color 0.2s ease;
font-size: 14px;
color: var(--td-text-color-primary);
color: #333;
&:hover {
background-color: var(--td-bg-color-container-hover);
background-color: #f5f5f5;
}
&.active {
background-color: var(--td-brand-color-light);
color: var(--td-brand-color);
background-color: #07c05f1a;
color: #07c05f;
font-weight: 500;
}
@@ -904,15 +895,15 @@ watch(() => route.params.kbId, () => {
</style>
<style lang="less">
.upload-popup {
background-color: var(--td-gray-color-13);
color: var(--td-text-color-anti);
border-color: var(--td-gray-color-13) !important;
background-color: rgba(0, 0, 0, 0.9);
color: #FFFFFF;
border-color: rgba(0, 0, 0, 0.9) !important;
box-shadow: none;
margin-bottom: 10px !important;
.t-popup__arrow::before {
border-color: var(--td-gray-color-13) !important;
background-color: var(--td-gray-color-13) !important;
border-color: rgba(0, 0, 0, 0.9) !important;
background-color: rgba(0, 0, 0, 0.9) !important;
box-shadow: none !important;
}
}
@@ -934,22 +925,22 @@ watch(() => route.params.kbId, () => {
// 退出登录确认框样式
:deep(.t-popconfirm) {
.t-popconfirm__content {
background: var(--td-bg-color-container);
border: 1px solid var(--td-component-border);
background: #fff;
border: 1px solid #e7e7e7;
border-radius: 6px;
box-shadow: var(--td-shadow-2);
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
padding: 12px 16px;
font-size: 14px;
color: var(--td-text-color-primary);
color: #333;
max-width: 200px;
}
.t-popconfirm__arrow {
border-bottom-color: var(--td-component-border);
border-bottom-color: #e7e7e7;
}
.t-popconfirm__arrow::after {
border-bottom-color: var(--td-bg-color-container);
border-bottom-color: #fff;
}
.t-popconfirm__buttons {
@@ -960,18 +951,18 @@ watch(() => route.params.kbId, () => {
}
.t-button--variant-outline {
border-color: var(--td-component-border);
color: var(--td-text-color-secondary);
border-color: #d9d9d9;
color: #666;
}
.t-button--theme-danger {
background-color: var(--td-error-color);
border-color: var(--td-error-color);
background-color: #ff4d4f;
border-color: #ff4d4f;
}
.t-button--theme-danger:hover {
background-color: var(--td-error-color-hover);
border-color: var(--td-error-color-hover);
background-color: #ff7875;
border-color: #ff7875;
}
}
</style>