diff --git a/frontend/src/components/common/MarkdownContent.vue b/frontend/src/components/common/MarkdownContent.vue index 6580f2e..f799288 100644 --- a/frontend/src/components/common/MarkdownContent.vue +++ b/frontend/src/components/common/MarkdownContent.vue @@ -17,32 +17,32 @@ watch(() => props.source, async (source) => {
- diff --git a/frontend/src/features/themes/ThemesView.vue b/frontend/src/features/themes/ThemesView.vue index 1a93a5d..33ebc69 100644 --- a/frontend/src/features/themes/ThemesView.vue +++ b/frontend/src/features/themes/ThemesView.vue @@ -1,6 +1,15 @@ @@ -29,14 +51,7 @@ const themeStore = useThemeStore() .preference-panel { display: grid; gap: var(--space-xl); } .editor-preview { padding: var(--space-xl); border: 1px solid var(--color-border-default); border-radius: var(--radius-md); background: var(--color-background-secondary); } .editor-preview p { margin: var(--space-sm) 0; } +.preview-heading { display: flex; align-items: center; justify-content: space-between; gap: var(--space-md); } .field small { color: var(--color-text-tertiary); } -.code-preview { overflow: auto; margin-top: var(--space-md); padding: 16px; border: 1px solid var(--color-code-border); border-radius: 6px; background: var(--color-code-background); color: var(--color-code-text); font: 13px/1.45 var(--font-ui-mono); } -:global([data-code-theme='github-light']) .code-keyword { color: #cf222e; } -:global([data-code-theme='github-light']) .code-variable { color: #24292f; } -:global([data-code-theme='github-light']) .code-function { color: #8250df; } -:global([data-code-theme='github-light']) .code-string { color: #0a3069; } -:global([data-code-theme='github-dark']) .code-keyword { color: #ff7b72; } -:global([data-code-theme='github-dark']) .code-variable { color: #c9d1d9; } -:global([data-code-theme='github-dark']) .code-function { color: #d2a8ff; } -:global([data-code-theme='github-dark']) .code-string { color: #a5d6ff; } +.code-theme-preview { margin-top: var(--space-md); } diff --git a/frontend/src/styles/motion.spec.ts b/frontend/src/styles/motion.spec.ts index 59f8e82..49cad55 100644 --- a/frontend/src/styles/motion.spec.ts +++ b/frontend/src/styles/motion.spec.ts @@ -10,6 +10,7 @@ const globalStyles = [ const markdownStyles = [ new URL('../features/editor/VisualMarkdownEditor.vue', import.meta.url), + new URL('../features/themes/ThemesView.vue', import.meta.url), new URL('../components/common/MarkdownContent.vue', import.meta.url), ].map((path) => readFileSync(path, 'utf8')).join('\n') @@ -36,4 +37,8 @@ describe('轻量动效基线', () => { expect(markdownStyles).toContain('var(--color-markdown-grid)') expect(markdownStyles).toContain('var(--color-markdown-marker)') }) + + it('不混用可能丢失后代选择器的 scoped global 写法', () => { + expect(markdownStyles).not.toMatch(/:global\([^\n]+\)\s+\./) + }) })