[next]feat: Shuishouji and JSON Workbench need to support font switching functionality.

This commit is contained in:
RememBerBer
2026-08-18 17:09:21 +08:00
parent 2fc15644c3
commit f7d26b034c
2 changed files with 4 additions and 2 deletions
+3 -2
View File
@@ -3357,6 +3357,7 @@ select:not([multiple]) {
background: transparent;
border: 0;
border-radius: 0;
font-family: var(--text-code-editor-font-family, "JetBrains Mono", "SFMono-Regular", ui-monospace, Menlo, Consolas, monospace);
font-size: var(--text-code-editor-font-size, var(--json-editor-font-size, 14px));
}
@@ -3368,12 +3369,12 @@ select:not([multiple]) {
height: 100%;
color: var(--editor-text);
background: transparent;
font-family: inherit;
font-size: inherit;
}
.json-editor .cm-scroller {
font-family:
"JetBrains Mono", "SFMono-Regular", ui-monospace, Menlo, Consolas, monospace;
font-family: inherit;
line-height: 1.7;
overflow: auto;
scrollbar-width: thin;
+1
View File
@@ -515,6 +515,7 @@ test('formats JSON and completes history and Vault workflows', async () => {
expect(Math.max(...jsonLineOffsets)).toBeLessThan(1.5)
await mainPage.getByLabel('字体').selectOption('Georgia')
await expect.poll(() => mainPage.locator('.json-editor').evaluate((element) => (element as HTMLElement).style.getPropertyValue('--text-code-editor-font-family'))).toContain('Georgia')
await expect.poll(() => mainPage.locator('.json-editor .cm-scroller').evaluate((element) => getComputedStyle(element).fontFamily)).toMatch(/Georgia/)
await expect.poll(() => mainPage.evaluate(() => window.mootool.getSettings())).toMatchObject({ editor: { jsonFontName: 'Georgia' } })
await mainPage.evaluate(() => window.mootool.updateSettings({ editor: { jsonFontSize: 14 } }))