Skip to content

Commit 0139f08

Browse files
authored
Issues with CSS in development mode (microsoft#237676) (microsoft#252939)
1 parent f63842c commit 0139f08

File tree

1 file changed

+6
-7
lines changed

1 file changed

+6
-7
lines changed

src/vs/code/electron-browser/workbench/workbench.ts

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -452,14 +452,13 @@
452452
if (Array.isArray(configuration.cssModules) && configuration.cssModules.length > 0) {
453453
performance.mark('code/willAddCssLoader');
454454

455-
const style = document.createElement('style');
456-
style.type = 'text/css';
457-
style.media = 'screen';
458-
style.id = 'vscode-css-loading';
459-
window.document.head.appendChild(style);
460-
461455
globalThis._VSCODE_CSS_LOAD = function (url) {
462-
style.textContent += `@import url(${url});\n`;
456+
const link = document.createElement('link');
457+
link.setAttribute('rel', 'stylesheet');
458+
link.setAttribute('type', 'text/css');
459+
link.setAttribute('href', url);
460+
461+
window.document.head.appendChild(link);
463462
};
464463

465464
const importMap: { imports: Record<string, string> } = { imports: {} };

0 commit comments

Comments
 (0)