💄 style(ui): replace inline gradients with reusable pastel blur balls; improve dark mode

- Introduce a global CSS utility `with-pastel-balls` in `web/src/index.css`, rendering pastel “blur balls” via ::before with CSS variables (`--pb1..--pb4`, `--pb-opacity`, `--pb-blur`) for easy theming.
- Apply the utility to pricing header cards and skeletons:
  - `web/src/components/table/model-pricing/layout/header/PricingVendorIntro.jsx`
  - `web/src/components/table/model-pricing/layout/header/PricingVendorIntroSkeleton.jsx`
- Remove per-component inline `linear-gradient(...)` backgrounds and redundant absolute-positioned decoration nodes to reduce duplication.
- Dark mode:
  - Keep the same pastel palette (pink/lavender/mint/peach).
  - Increase visibility with `--pb-opacity: 0.36`, `--pb-blur: 65px`, and `mix-blend-mode: screen`.
- No functional logic changes; UI-only. Lint passes.

Affected files:
- web/src/index.css
- web/src/components/table/model-pricing/layout/header/PricingVendorIntro.jsx
- web/src/components/table/model-pricing/layout/header/PricingVendorIntroSkeleton.jsx
This commit is contained in:
t0ng7u
2025-08-09 21:40:32 +08:00
parent 24860fdc05
commit 0727353afa
4 changed files with 140 additions and 6 deletions

View File

@@ -593,6 +593,60 @@ html:not(.dark) .blur-ball-teal {
opacity: 0.2;
}
/* ==================== 卡片马卡龙模糊球(类封装) ==================== */
/* 使用方式:给容器加上 with-pastel-balls 类即可,无需在 JSX 中插入额外节点 */
.with-pastel-balls {
position: relative;
overflow: hidden;
/* 默认变量(明亮模式) */
--pb1: #ffd1dc;
/* 粉 */
--pb2: #e5d4ff;
/* 薰衣草 */
--pb3: #d1fff6;
/* 薄荷 */
--pb4: #ffe5d9;
/* 桃 */
--pb-opacity: 0.55;
--pb-blur: 60px;
}
.with-pastel-balls::before {
content: '';
position: absolute;
inset: 0;
pointer-events: none;
z-index: 0;
background:
radial-gradient(circle at -5% -10%, var(--pb1) 0%, transparent 60%),
radial-gradient(circle at 105% -10%, var(--pb2) 0%, transparent 55%),
radial-gradient(circle at 5% 110%, var(--pb3) 0%, transparent 55%),
radial-gradient(circle at 105% 110%, var(--pb4) 0%, transparent 50%);
filter: blur(var(--pb-blur));
opacity: var(--pb-opacity);
transform: translateZ(0);
}
/* 暗黑模式下更柔和的色彩和透明度 */
html.dark .with-pastel-balls {
/* 使用与明亮模式一致的“刚才那组”马卡龙色,但整体更柔和 */
--pb1: #ffd1dc;
/* 粉 */
--pb2: #e5d4ff;
/* 薰衣草 */
--pb3: #d1fff6;
/* 薄荷 */
--pb4: #ffe5d9;
/* 桃 */
--pb-opacity: 0.36;
--pb-blur: 65px;
}
/* 暗黑模式下用更柔和的混合模式避免突兀的高亮 */
html.dark .with-pastel-balls::before {
mix-blend-mode: screen;
}
/* ==================== 表格卡片滚动设置 ==================== */
.table-scroll-card {
display: flex;