style(frontend): update component styles for consistency and usability

- Change background colors in menu and user message components for better visual coherence
- Adjust text colors and font weights in UserMenu for improved readability
- Enhance suggested questions layout with updated spacing and alignment
- Refine chat message styles for better responsiveness and user experience
- Update hover effects and transitions for suggested question cards
This commit is contained in:
wizardchen
2026-06-18 14:54:51 +08:00
committed by lyingbug
parent 4e2d568149
commit 95b97dc379
6 changed files with 140 additions and 82 deletions
+7 -7
View File
@@ -1006,7 +1006,7 @@ onUnmounted(() => {
background: var(--td-bg-color-container-hover); background: var(--td-bg-color-container-hover);
.dropdown-tenant-panel-trail { .dropdown-tenant-panel-trail {
color: var(--td-brand-color); color: var(--td-text-color-secondary);
} }
} }
} }
@@ -1324,12 +1324,12 @@ onUnmounted(() => {
} }
&.is-current { &.is-current {
background: rgba(7, 192, 95, 0.08); background: var(--td-bg-color-secondarycontainer);
cursor: default; cursor: default;
.tenant-submenu-item-name { .tenant-submenu-item-name {
color: var(--td-brand-color); color: var(--td-text-color-primary);
font-weight: 500; font-weight: 600;
} }
} }
} }
@@ -1400,8 +1400,8 @@ onUnmounted(() => {
line-height: 1.2; line-height: 1.2;
padding: 2px 6px; padding: 2px 6px;
border-radius: 4px; border-radius: 4px;
background: var(--td-brand-color-light); background: var(--td-bg-color-component);
color: var(--td-brand-color); color: var(--td-text-color-secondary);
} }
// Home 标识改为叠在 avatar 右下角的小 dot,不在 meta 行额外占位,让 // Home 标识改为叠在 avatar 右下角的小 dot,不在 meta 行额外占位,让
@@ -1419,7 +1419,7 @@ onUnmounted(() => {
height: 14px; height: 14px;
border-radius: 50%; border-radius: 50%;
background: var(--td-bg-color-container); background: var(--td-bg-color-container);
color: var(--td-brand-color); color: var(--td-text-color-secondary);
border: 1.5px solid var(--td-bg-color-container); border: 1.5px solid var(--td-bg-color-container);
display: flex; display: flex;
align-items: center; align-items: center;
@@ -18,28 +18,29 @@
.suggested-questions-inner { .suggested-questions-inner {
display: flex; display: flex;
flex-direction: column; flex-direction: column;
align-items: center; align-items: stretch;
width: 100%; width: 100%;
} }
.suggested-questions-title-row { .suggested-questions-title-row {
margin-bottom: 8px; margin-bottom: 12px;
text-align: center;
} }
.suggested-questions-caption { .suggested-questions-caption {
display: inline-flex; display: inline-flex;
align-items: center; align-items: center;
gap: 4px; gap: 6px;
margin: 0; margin: 0;
padding: 0; padding: 0;
line-height: 1; line-height: 1;
} }
.suggested-questions-title { .suggested-questions-title {
font-size: 12px; font-size: 13px;
color: var(--td-text-color-placeholder); color: var(--td-text-color-placeholder);
font-weight: 400; font-weight: 400;
letter-spacing: 0.02em; letter-spacing: 0.01em;
} }
.suggested-questions-refresh { .suggested-questions-refresh {
@@ -47,11 +48,11 @@
align-items: center; align-items: center;
justify-content: center; justify-content: center;
flex-shrink: 0; flex-shrink: 0;
width: 18px; width: 20px;
height: 18px; height: 20px;
padding: 0; padding: 0;
border: none; border: none;
border-radius: 4px; border-radius: 6px;
background: transparent; background: transparent;
color: var(--td-text-color-placeholder); color: var(--td-text-color-placeholder);
cursor: pointer; cursor: pointer;
@@ -62,12 +63,12 @@
} }
&:hover:not(:disabled) { &:hover:not(:disabled) {
color: var(--td-text-color-secondary); color: var(--td-brand-color);
background: var(--td-bg-color-secondarycontainer); background: var(--td-bg-color-secondarycontainer);
} }
&:active:not(:disabled) { &:active:not(:disabled) {
transform: scale(0.94); transform: scale(0.92);
} }
&:disabled { &:disabled {
@@ -93,42 +94,112 @@
.suggested-questions-grid { .suggested-questions-grid {
display: flex; display: flex;
flex-wrap: wrap; flex-wrap: wrap;
gap: 8px;
justify-content: center; justify-content: center;
gap: 10px;
width: 100%; width: 100%;
} }
.suggested-question-card { .suggested-question-card {
position: relative;
display: inline-flex; display: inline-flex;
align-items: center; align-items: center;
gap: 6px; gap: 8px;
min-width: 0;
max-width: 100%; max-width: 100%;
padding: 6px 12px; width: auto;
border-radius: 8px; box-sizing: border-box;
padding: 11px 14px;
border-radius: 14px;
border: 1px solid var(--td-component-stroke); border: 1px solid var(--td-component-stroke);
background: transparent; background: var(--td-bg-color-container);
cursor: pointer; cursor: pointer;
overflow: hidden;
transition: transition:
background 0.2s @suggested-ease, background 0.25s @suggested-ease,
border-color 0.2s @suggested-ease, border-color 0.25s @suggested-ease,
transform 0.15s @suggested-ease; box-shadow 0.25s @suggested-ease,
transform 0.2s @suggested-ease;
// 左侧主题色渐隐高光,hover 时淡入,营造柔和的呼吸感
&::before {
content: "";
position: absolute;
inset: 0;
border-radius: inherit;
background: linear-gradient(
105deg,
var(--td-brand-color-light) 0%,
transparent 55%
);
opacity: 0;
transition: opacity 0.25s @suggested-ease;
pointer-events: none;
}
&:not(.sq-card-skeleton):hover { &:not(.sq-card-skeleton):hover {
background: var(--td-bg-color-secondarycontainer); border-color: var(--td-brand-color-light-active, var(--td-brand-color));
border-color: var(--td-component-border); background: var(--td-bg-color-container);
box-shadow: 0 3px 10px -8px rgba(0, 0, 0, 0.14);
transform: translateY(-1px);
&::before {
opacity: 0.45;
}
}
// 右侧引导箭头:默认隐藏并向左收起,hover 时滑入
&::after {
content: "›";
position: relative;
flex-shrink: 0;
margin-left: -2px;
font-size: 17px;
line-height: 1;
color: var(--td-brand-color);
opacity: 0;
transform: translateX(-6px);
transition:
opacity 0.25s @suggested-ease,
transform 0.25s @suggested-ease;
} }
&:not(.sq-card-skeleton):active { &:not(.sq-card-skeleton):active {
transform: scale(0.98); transform: translateY(0) scale(0.99);
background: var(--td-bg-color-secondarycontainer-active); box-shadow: 0 2px 8px -6px rgba(0, 0, 0, 0.2);
}
&:not(.sq-card-skeleton):hover::after {
opacity: 1;
transform: translateX(0);
} }
&.sq-card-skeleton { &.sq-card-skeleton {
width: 180px;
max-width: 100%;
pointer-events: none; pointer-events: none;
cursor: default; cursor: default;
flex-shrink: 0; flex-shrink: 0;
border-color: transparent; border-color: transparent;
background: var(--td-bg-color-secondarycontainer); background: var(--td-bg-color-secondarycontainer);
box-shadow: none;
// 不等宽的骨架,呼应错落的标签云布局
&:nth-child(2n) {
width: 240px;
}
&:nth-child(3n) {
width: 150px;
}
&:nth-child(5n) {
width: 210px;
}
&::before,
&::after {
display: none;
}
:deep(.t-skeleton) { :deep(.t-skeleton) {
width: 100%; width: 100%;
@@ -142,36 +213,16 @@
border-radius: 3px; border-radius: 3px;
} }
&:nth-child(1) {
width: 132px;
}
&:nth-child(2) {
width: 168px;
}
&:nth-child(3) {
width: 116px;
}
&:nth-child(4) {
width: 152px;
}
&:nth-child(5) {
width: 124px;
}
&:nth-child(6) {
width: 144px;
}
} }
} }
.suggested-question-text { .suggested-question-text {
position: relative;
flex: 0 1 auto;
min-width: 0;
font-size: 13px; font-size: 13px;
line-height: 1.5; line-height: 1.5;
color: var(--td-text-color-secondary); color: var(--td-text-color-primary);
overflow: hidden; overflow: hidden;
text-overflow: ellipsis; text-overflow: ellipsis;
white-space: nowrap; white-space: nowrap;
@@ -179,19 +230,21 @@
} }
.suggested-question-card:not(.sq-card-skeleton):hover .suggested-question-text { .suggested-question-card:not(.sq-card-skeleton):hover .suggested-question-text {
color: var(--td-text-color-primary); color: var(--td-brand-color);
} }
.suggested-question-badge { .suggested-question-badge {
position: relative;
flex-shrink: 0; flex-shrink: 0;
padding: 0 4px; padding: 1px 6px;
border-radius: 3px; border-radius: 6px;
border: 1px solid var(--td-component-stroke); border: none;
background: transparent; background: var(--td-brand-color-light);
font-size: 10px; font-size: 10px;
font-weight: 500; font-weight: 600;
line-height: 1.6; line-height: 1.6;
letter-spacing: 0.04em; letter-spacing: 0.04em;
text-transform: uppercase; text-transform: uppercase;
color: var(--td-text-color-placeholder); color: var(--td-brand-color);
} }
+1 -1
View File
@@ -1385,7 +1385,7 @@ const onDragHandleMouseDown = (e: MouseEvent) => {
.menu_item_active { .menu_item_active {
border-radius: 4px; border-radius: 4px;
background: var(--td-brand-color-light) !important; background: var(--td-bg-color-secondarycontainer) !important;
.menu_icon, .menu_icon,
.menu_title { .menu_title {
+12 -10
View File
@@ -221,21 +221,23 @@ const closePreImg = () => {
.user_msg { .user_msg {
width: max-content; width: max-content;
max-width: 776px; max-width: min(76%, 680px);
display: flex; display: flex;
padding: 10px 12px; padding: 8px 12px;
flex-direction: column; flex-direction: column;
justify-content: center; justify-content: center;
align-items: center; align-items: flex-start;
gap: 4px; gap: 4px;
flex: 1 0 0; flex: 1 0 0;
border-radius: 4px; border-radius: 8px;
background: #8CE97F; background: var(--td-bg-color-secondarycontainer);
margin-left: auto; margin-left: auto;
color: #000000e6; color: var(--td-text-color-primary);
font-size: 16px; font-size: 16px;
text-align: justify; line-height: 1.6;
word-break: break-all; text-align: left;
word-break: break-word;
overflow-wrap: anywhere;
box-sizing: border-box; box-sizing: border-box;
white-space: pre-wrap; white-space: pre-wrap;
} }
@@ -348,8 +350,8 @@ const closePreImg = () => {
html[theme-mode="dark"] { html[theme-mode="dark"] {
.user_msg { .user_msg {
background: var(--td-brand-color-3); background: var(--td-bg-color-secondarycontainer);
color: rgba(255, 255, 255, 0.9); color: var(--td-text-color-primary);
} }
} }
</style> </style>
+2 -1
View File
@@ -338,7 +338,8 @@ const handleKBEditorSuccess = (kbId: string) => {
opacity 0.35s @suggested-ease, opacity 0.35s @suggested-ease,
transform 0.35s @suggested-ease, transform 0.35s @suggested-ease,
background 0.2s @suggested-ease, background 0.2s @suggested-ease,
border-color 0.2s @suggested-ease; border-color 0.25s @suggested-ease,
box-shadow 0.25s @suggested-ease;
&.sq-card-skeleton { &.sq-card-skeleton {
opacity: 1; opacity: 1;
+11 -9
View File
@@ -106,15 +106,17 @@ const formatFileSize = (bytes: number): string => {
.user_msg { .user_msg {
width: max-content; width: max-content;
max-width: 776px; max-width: min(76%, 680px);
padding: 10px 12px; padding: 8px 12px;
border-radius: 4px; border-radius: 8px;
background: #8ce97f; background: var(--td-bg-color-secondarycontainer);
margin-left: auto; margin-left: auto;
color: #000000e6; color: var(--td-text-color-primary);
font-size: 16px; font-size: 16px;
text-align: justify; line-height: 1.6;
word-break: break-all; text-align: left;
word-break: break-word;
overflow-wrap: anywhere;
box-sizing: border-box; box-sizing: border-box;
white-space: pre-wrap; white-space: pre-wrap;
} }
@@ -167,7 +169,7 @@ const formatFileSize = (bytes: number): string => {
} }
html[theme-mode='dark'] .user_msg { html[theme-mode='dark'] .user_msg {
background: var(--td-brand-color-3); background: var(--td-bg-color-secondarycontainer);
color: rgba(255, 255, 255, 0.9); color: var(--td-text-color-primary);
} }
</style> </style>