VS Code Web:突出 TODO/FIXME 注释
用淡黄色背景突出包含 TODO 和 FIXME 注释的行(github.dev 也适用)。
可复制的代码
/* Highlight TODO and FIXME comment tokens in the editor (works on github.dev too) */
.monaco-editor .mtk1[style*="italic"],
.monaco-editor span.mtk3,
.monaco-editor span.mtk6 {
/* Generic comment tokens vary by theme; broaden the catch */
}
.monaco-editor .view-line span:where([class*="mtk"]) {
--vsc-todo-bg: rgba(255,209,102,0.25);
}
.monaco-editor .view-line:has(span:where([class*="mtk"]):where([title*="TODO"], [title*="FIXME"])) {
background: rgba(255,209,102,0.08) !important;
border-left: 3px solid #ffd166 !important;
}
如何使用此示例
- 用上方按钮复制代码。
- 安装 JustZix(2 分钟),在目标页面打开扩展。
- 添加一条匹配该页面的新规则。
- 将代码粘贴到规则的 CSS 面板并保存 — 效果立即生效。
为此示例评分
暂无评分 — 成为第一个。