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:
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user