diff options
Diffstat (limited to 'frontend/src/lib/mobileCss.test.ts')
| -rw-r--r-- | frontend/src/lib/mobileCss.test.ts | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/frontend/src/lib/mobileCss.test.ts b/frontend/src/lib/mobileCss.test.ts index c4d1efb..af7251f 100644 --- a/frontend/src/lib/mobileCss.test.ts +++ b/frontend/src/lib/mobileCss.test.ts @@ -47,6 +47,41 @@ describe('375px responsive sizing (no global content hiding)', () => { }); }); +describe('round3 shadcn-svelte 主题 tokens(b1D0dv72 preset 精神 + 截图重配)', () => { + it('radius 上调至 0.75rem(Stripe 风格大圆角),shadcn radius-lg 由此派生', () => { + expect(appCss).toMatch(/--radius:\s*0\.75rem/); + expect(appCss).toMatch(/--radius-lg:\s*var\(--radius\)/); + }); + + it('mint 默认 + amber 双套变量组(用户 create 截图色值)', () => { + // mint ~#70DAB6 / 深一档 #58D3AA;amber ~#F0AE00 + expect(appCss).toContain('--brand: #58d3aa'); + expect(appCss).toContain('--ring: #70dab6'); + expect(appCss).toMatch(/\.theme-amber\s*\{/); + expect(appCss).toContain('--brand: #f0ae00'); + // 默认 mint、amber 仅通过 .theme-amber 切换(src/lib/theme.ts 挂类) + expect(appCss).not.toMatch(/NAVER/); + }); + + it('数字排印:tabular-nums 大字重(mvalue 1.5rem/700),保留 .num/.metric-grid', () => { + expect(appCss).toMatch(/\.mvalue\s*\{[^}]*font-weight:\s*700/); + expect(appCss).toMatch(/\.mvalue\s*\{[^}]*font-variant-numeric:\s*tabular-nums/); + expect(appCss).toContain('.metric-grid {'); + }); + + it('legacy 组件选择器已从 app.css 删除(.btn/.banner 变体/.badge/.tabs/table.data 组件样式)', () => { + expect(appCss).not.toMatch(/\.btn\s*\{|\.\btn\.|\.btn\./); + expect(appCss).not.toContain('.btn.primary {'); + expect(appCss).not.toContain('.badge.teal {'); + expect(appCss).not.toContain('.tabs button {'); + expect(appCss).not.toContain('table.data th {'); + expect(appCss).not.toContain('.metric {'); + expect(appCss).not.toContain('.metric-card {'); + // .banner 仅剩窄视口防溢出工具(无颜色组件样式) + expect(appCss).not.toContain('.banner.error {'); + }); +}); + function getMediaBlock(css, query) { const idx = css.indexOf(`@media ${query}`); if (idx < 0) return null; |
