Change:
Type: <bBug</bThe fix for seems to have stopped working in the latest Insiders build. VS Code version: Code - Insiders 1.85.0-insider (, 2023-11-06T05:34:22.485Z) OS version: WindowsNT x64 10.0. Modes: Remote OS version: Linux x64 4.18.0-372.19.1.el86.x8664 <details<summarySystem Info</summary </details<!-- generated by issue reporter --
Range:
Really a bad bug: none of the global styles would get copied properly, a lot of other CSS related things must have been broken. Fix tomorrow!
<!-- AUTHORVERIFICATIONREQUEST --This bug has been fixed in the latest release of ! you can help us out by commenting if things are now working as expected. If things still don't seem right, please ensure you're on version of Insiders (today's or later - you can use in the command palette to check), and leave a comment letting us know what isn't working as expected. Happy Coding!
/verified

Discussion:
} } <ins> const globalStylesheets = new Map<HTMLStyleElement /* main stylesheet */, Set<HTMLStyleElement /* aux window clones that track the main stylesheet */>>(); export function isGlobalStylesheet(node: Node): boolean { return globalStylesheets.has(node as HTMLStyleElement); } </ins> export function createStyleSheet(container: HTMLElement = document.head, beforeAppend?: (style: HTMLStyleElement) => void, disposableStore?: DisposableStore): HTMLStyleElement { const style = document.createElement('style'); style.type = 'text/css';

// With <head> as container, the stylesheet becomes global and is tracked // to support auxiliary windows to clone the stylesheet. if (container === document.head) { <ins> const globalStylesheetClones = new Set<HTMLStyleElement>(); globalStylesheets.set(style, globalStylesheetClones); </ins> for (const { window: targetWindow, disposables } of getWindows()) { if (targetWindow === mainWindow) { continue; // main window is already tracked } <del> const cloneDisposable = disposables.add(cloneGlobalStyleSheet(style, targetWindow)); </del> <ins> const cloneDisposable = disposables.add(cloneGlobalStyleSheet(style, globalStylesheetClones, targetWindow)); </ins> disposableStore?.add(cloneDisposable); } } return style; } <del> const globalStylesheets = new Map<HTMLStyleElement /* main stylesheet */, Set<HTMLStyleElement /* aux window clones that track the main stylesheet */>>(); export function isGlobalStylesheet(node: Node): boolean { return globalStylesheets.has(node as HTMLStyleElement); } </del> export function cloneGlobalStylesheets(targetWindow: Window): IDisposable { const disposables = new DisposableStore(); <del> for (const [globalStylesheet] of globalStylesheets) { disposables.add(cloneGlobalStyleSheet(globalStylesheet, targetWindow)); </del> <ins> for (const [globalStylesheet, clonedGlobalStylesheets] of globalStylesheets) { disposables.add(cloneGlobalStyleSheet(globalStylesheet, clonedGlobalStylesheets, targetWindow)); </ins> } return disposables; } <del> function cloneGlobalStyleSheet(globalStylesheet: HTMLStyleElement, targetWindow: Window): IDisposable { </del> <ins> function cloneGlobalStyleSheet(globalStylesheet: HTMLStyleElement, globalStylesheetClones: Set<HTMLStyleElement>, targetWindow: Window): IDisposable { </ins> const disposables = new DisposableStore(); const clone = globalStylesheet.cloneNode(true) as HTMLStyleElement;

clone.textContent = globalStylesheet.textContent; })); <del> let clonedGlobalStylesheets = globalStylesheets.get(globalStylesheet); if (!clonedGlobalStylesheets) { clonedGlobalStylesheets = new Set<HTMLStyleElement>(); globalStylesheets.set(globalStylesheet, clonedGlobalStylesheets); } clonedGlobalStylesheets.add(clone); disposables.add(toDisposable(() => clonedGlobalStylesheets?.delete(clone))); </del> <ins> globalStylesheetClones.add(clone); disposables.add(toDisposable(() => globalStylesheetClones.delete(clone))); </ins> return disposables; }