Skip to content

Commit 3994e92

Browse files
committed
Make mtk classes more specific to avoid CSS conflicts
1 parent 15e798e commit 3994e92

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

src/vs/editor/common/modes/supports/tokenization.ts

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -397,12 +397,13 @@ export class ThemeTrieElement {
397397

398398
export function generateTokensCSSForColorMap(colorMap: Color[]): string {
399399
let rules: string[] = [];
400+
const editorParentClass = ".monaco-editor";
400401
for (let i = 1, len = colorMap.length; i < len; i++) {
401402
let color = colorMap[i];
402-
rules[i] = `.mtk${i} { color: ${color}; }`;
403+
rules[i] = `${editorParentClass} .mtk${i} { color: ${color}; }`;
403404
}
404-
rules.push('.mtki { font-style: italic; }');
405-
rules.push('.mtkb { font-weight: bold; }');
406-
rules.push('.mtku { text-decoration: underline; text-underline-position: under; }');
405+
rules.push(`${editorParentClass} .mtki { font-style: italic; }`);
406+
rules.push(`${editorParentClass} .mtkb { font-weight: bold; }`);
407+
rules.push(`${editorParentClass} .mtku { text-decoration: underline; text-underline-position: under; }`);
407408
return rules.join('\n');
408409
}

0 commit comments

Comments
 (0)