From cbd5ed73a5a62d133fcdf2b7ed1b8c7d8451e986 Mon Sep 17 00:00:00 2001 From: nrenvo Date: Tue, 27 Oct 2026 15:13:58 +0000 Subject: [PATCH] fix(theme): allow injected CSS to style Monaco view containers (#8385) `@scope`'s `to` bound excludes the boundary elements themselves, so rules targeting `.view-lines` never matched. Move the bound to its children with `> *`: the container becomes styleable, its internals stay excluded. --- Changelog.md | 1 + src/pages/_layout/hooks/use-custom-theme.ts | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/Changelog.md b/Changelog.md index 7c4b8dba2..8c8d3e2d0 100644 --- a/Changelog.md +++ b/Changelog.md @@ -8,6 +8,7 @@ - 修复 首页 网站测速失败后卡片一直显示测试中 - 修复 代理 页展开分组后不显示最新测速结果,需切换节点才刷新 - 修复 代理 在全局模式下无法展开节点组 +- 修复 自定义 CSS 无法修改编辑器字体和字号的问题 **🐧 Linux** diff --git a/src/pages/_layout/hooks/use-custom-theme.ts b/src/pages/_layout/hooks/use-custom-theme.ts index 464159b40..fd765f6fd 100644 --- a/src/pages/_layout/hooks/use-custom-theme.ts +++ b/src/pages/_layout/hooks/use-custom-theme.ts @@ -55,7 +55,7 @@ const wrapCssInjectionWithScope = (css?: string) => { return null } const scopeRoot = CSS_INJECTION_SCOPE_ROOT - const scopeLimit = CSS_INJECTION_SCOPE_LIMIT + const scopeLimit = `${CSS_INJECTION_SCOPE_LIMIT} > *` const scopedBlock = `@scope (${scopeRoot}) to (${scopeLimit}) { ${css} }`