mirror of
https://github.com/jxxghp/MoviePilot-Frontend.git
synced 2026-09-10 02:06:44 +08:00
fix(glass): keep dashboard hover on the same material contour
This commit is contained in:
@@ -4,6 +4,18 @@ import { cwd } from 'node:process'
|
||||
import { describe, expect, it } from 'vitest'
|
||||
|
||||
describe('glass overlay material styles', () => {
|
||||
it('keeps dashboard hover on one contour instead of restoring legacy inset lines', () => {
|
||||
const legacy = readFileSync(resolve(cwd(), 'src/styles/themes/glass.scss'), 'utf8')
|
||||
const surfaces = readFileSync(resolve(cwd(), 'src/styles/themes/_glass-v3.scss'), 'utf8')
|
||||
|
||||
expect(legacy).not.toContain(
|
||||
'.dashboard-grid-item-content > .dashboard-grid-auto-size > .dashboard-grid-content-measure > .v-card:hover',
|
||||
)
|
||||
expect(surfaces).toMatch(
|
||||
/--glass-v3-rim: clamp\(0\.2,[\s\S]*?box-shadow: var\(--glass-v3-surface-edge\), var\(--glass-v3-shadow\) !important/u,
|
||||
)
|
||||
})
|
||||
|
||||
it('shares the soft contour between content cards and detached navigation', () => {
|
||||
const styles = readFileSync(resolve(cwd(), 'src/styles/themes/_glass-v3.scss'), 'utf8')
|
||||
|
||||
|
||||
@@ -238,6 +238,9 @@
|
||||
.dashboard-grid-content-measure > :first-child > .v-card:hover {
|
||||
--glass-v3-rim: clamp(0.2, calc(0.22 + var(--glass-reflection, 0.38) * 0.36), 0.54);
|
||||
--glass-v3-shadow: 0 16px 34px rgba(0, 0, 0, 0.18);
|
||||
|
||||
// 悬停沿用静态轮廓,只增强其受光和投影,不切换到独立的硬质描边。
|
||||
box-shadow: var(--glass-v3-surface-edge), var(--glass-v3-shadow) !important;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -448,18 +448,6 @@ html[data-theme='glass'] {
|
||||
box-shadow: var(--glass-dashboard-shadow) !important;
|
||||
}
|
||||
|
||||
@media (hover: hover) {
|
||||
// Dashboard 悬停沿左上来光增强顶部高光,并在右下背光面保留轻吸收。
|
||||
.dashboard-grid-item-content > .dashboard-grid-auto-size > .dashboard-grid-content-measure > .v-card:hover,
|
||||
.dashboard-grid-item-content
|
||||
> .dashboard-grid-auto-size
|
||||
> .dashboard-grid-content-measure
|
||||
> :first-child
|
||||
> .v-card:hover {
|
||||
box-shadow: var(--glass-dashboard-shadow-hover) !important;
|
||||
}
|
||||
}
|
||||
|
||||
.layout-navbar {
|
||||
border-color: var(--glass-border-raised) !important;
|
||||
-webkit-backdrop-filter: var(--glass-raised-backdrop-filter);
|
||||
|
||||
Reference in New Issue
Block a user