mirror of
https://github.com/rememberber/MooTool.git
synced 2026-09-01 15:34:30 +08:00
[next]feat: Shuishouji and JSON Workbench need to support font switching functionality.
This commit is contained in:
@@ -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;
|
||||
|
||||
@@ -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 } }))
|
||||
|
||||
|
||||
Reference in New Issue
Block a user