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);
.dropdown-tenant-panel-trail {
color: var(--td-brand-color);
color: var(--td-text-color-secondary);
}
}
}
@@ -1324,12 +1324,12 @@ onUnmounted(() => {
}
&.is-current {
background: rgba(7, 192, 95, 0.08);
background: var(--td-bg-color-secondarycontainer);
cursor: default;
.tenant-submenu-item-name {
color: var(--td-brand-color);
font-weight: 500;
color: var(--td-text-color-primary);
font-weight: 600;
}
}
}
@@ -1400,8 +1400,8 @@ onUnmounted(() => {
line-height: 1.2;
padding: 2px 6px;
border-radius: 4px;
background: var(--td-brand-color-light);
color: var(--td-brand-color);
background: var(--td-bg-color-component);
color: var(--td-text-color-secondary);
}
// Home 标识改为叠在 avatar 右下角的小 dot,不在 meta 行额外占位,让
@@ -1419,7 +1419,7 @@ onUnmounted(() => {
height: 14px;
border-radius: 50%;
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);
display: flex;
align-items: center;
@@ -18,28 +18,29 @@
.suggested-questions-inner {
display: flex;
flex-direction: column;
align-items: center;
align-items: stretch;
width: 100%;
}
.suggested-questions-title-row {
margin-bottom: 8px;
margin-bottom: 12px;
text-align: center;
}
.suggested-questions-caption {
display: inline-flex;
align-items: center;
gap: 4px;
gap: 6px;
margin: 0;
padding: 0;
line-height: 1;
}
.suggested-questions-title {
font-size: 12px;
font-size: 13px;
color: var(--td-text-color-placeholder);
font-weight: 400;
letter-spacing: 0.02em;
letter-spacing: 0.01em;
}
.suggested-questions-refresh {
@@ -47,11 +48,11 @@
align-items: center;
justify-content: center;
flex-shrink: 0;
width: 18px;
height: 18px;
width: 20px;
height: 20px;
padding: 0;
border: none;
border-radius: 4px;
border-radius: 6px;
background: transparent;
color: var(--td-text-color-placeholder);
cursor: pointer;
@@ -62,12 +63,12 @@
}
&:hover:not(:disabled) {
color: var(--td-text-color-secondary);
color: var(--td-brand-color);
background: var(--td-bg-color-secondarycontainer);
}
&:active:not(:disabled) {
transform: scale(0.94);
transform: scale(0.92);
}
&:disabled {
@@ -93,42 +94,112 @@
.suggested-questions-grid {
display: flex;
flex-wrap: wrap;
gap: 8px;
justify-content: center;
gap: 10px;
width: 100%;
}
.suggested-question-card {
position: relative;
display: inline-flex;
align-items: center;
gap: 6px;
gap: 8px;
min-width: 0;
max-width: 100%;
padding: 6px 12px;
border-radius: 8px;
width: auto;
box-sizing: border-box;
padding: 11px 14px;
border-radius: 14px;
border: 1px solid var(--td-component-stroke);
background: transparent;
background: var(--td-bg-color-container);
cursor: pointer;
overflow: hidden;
transition:
background 0.2s @suggested-ease,
border-color 0.2s @suggested-ease,
transform 0.15s @suggested-ease;
background 0.25s @suggested-ease,
border-color 0.25s @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 {
background: var(--td-bg-color-secondarycontainer);
border-color: var(--td-component-border);
border-color: var(--td-brand-color-light-active, var(--td-brand-color));
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 {
transform: scale(0.98);
background: var(--td-bg-color-secondarycontainer-active);
transform: translateY(0) scale(0.99);
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 {
width: 180px;
max-width: 100%;
pointer-events: none;
cursor: default;
flex-shrink: 0;
border-color: transparent;
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) {
width: 100%;
@@ -142,36 +213,16 @@
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 {
position: relative;
flex: 0 1 auto;
min-width: 0;
font-size: 13px;
line-height: 1.5;
color: var(--td-text-color-secondary);
color: var(--td-text-color-primary);
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
@@ -179,19 +230,21 @@
}
.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 {
position: relative;
flex-shrink: 0;
padding: 0 4px;
border-radius: 3px;
border: 1px solid var(--td-component-stroke);
background: transparent;
padding: 1px 6px;
border-radius: 6px;
border: none;
background: var(--td-brand-color-light);
font-size: 10px;
font-weight: 500;
font-weight: 600;
line-height: 1.6;
letter-spacing: 0.04em;
text-transform: uppercase;
color: var(--td-text-color-placeholder);
color: var(--td-brand-color);
}
+2 -2
View File
@@ -1385,7 +1385,7 @@ const onDragHandleMouseDown = (e: MouseEvent) => {
.menu_item_active {
border-radius: 4px;
background: var(--td-brand-color-light) !important;
background: var(--td-bg-color-secondarycontainer) !important;
.menu_icon,
.menu_title {
@@ -2066,4 +2066,4 @@ html[theme-mode="dark"] .aside_box .menu_item_active .menu_icon img.icon {
border-color: var(--td-error-color);
}
}
</style>
</style>
+12 -10
View File
@@ -221,21 +221,23 @@ const closePreImg = () => {
.user_msg {
width: max-content;
max-width: 776px;
max-width: min(76%, 680px);
display: flex;
padding: 10px 12px;
padding: 8px 12px;
flex-direction: column;
justify-content: center;
align-items: center;
align-items: flex-start;
gap: 4px;
flex: 1 0 0;
border-radius: 4px;
background: #8CE97F;
border-radius: 8px;
background: var(--td-bg-color-secondarycontainer);
margin-left: auto;
color: #000000e6;
color: var(--td-text-color-primary);
font-size: 16px;
text-align: justify;
word-break: break-all;
line-height: 1.6;
text-align: left;
word-break: break-word;
overflow-wrap: anywhere;
box-sizing: border-box;
white-space: pre-wrap;
}
@@ -348,8 +350,8 @@ const closePreImg = () => {
html[theme-mode="dark"] {
.user_msg {
background: var(--td-brand-color-3);
color: rgba(255, 255, 255, 0.9);
background: var(--td-bg-color-secondarycontainer);
color: var(--td-text-color-primary);
}
}
</style>
+2 -1
View File
@@ -338,7 +338,8 @@ const handleKBEditorSuccess = (kbId: string) => {
opacity 0.35s @suggested-ease,
transform 0.35s @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 {
opacity: 1;
+11 -9
View File
@@ -106,15 +106,17 @@ const formatFileSize = (bytes: number): string => {
.user_msg {
width: max-content;
max-width: 776px;
padding: 10px 12px;
border-radius: 4px;
background: #8ce97f;
max-width: min(76%, 680px);
padding: 8px 12px;
border-radius: 8px;
background: var(--td-bg-color-secondarycontainer);
margin-left: auto;
color: #000000e6;
color: var(--td-text-color-primary);
font-size: 16px;
text-align: justify;
word-break: break-all;
line-height: 1.6;
text-align: left;
word-break: break-word;
overflow-wrap: anywhere;
box-sizing: border-box;
white-space: pre-wrap;
}
@@ -167,7 +169,7 @@ const formatFileSize = (bytes: number): string => {
}
html[theme-mode='dark'] .user_msg {
background: var(--td-brand-color-3);
color: rgba(255, 255, 255, 0.9);
background: var(--td-bg-color-secondarycontainer);
color: var(--td-text-color-primary);
}
</style>