mirror of
https://github.com/microsoft/vscode.git
synced 2026-04-24 10:38:59 +01:00
No more need to use monacoShadowRoot in createStyleSheet because all standalone editor calls are qualified
This commit is contained in:
@@ -837,20 +837,11 @@ export function isInShadowDOM(domNode: Node): boolean {
|
||||
return isShadowRoot(domNode);
|
||||
}
|
||||
|
||||
export function createStyleSheet(container: HTMLElement | null = null): HTMLStyleElement {
|
||||
if (!container) {
|
||||
if ((window as any).monacoShadowRoot) {
|
||||
container = (window as any).monacoShadowRoot.querySelector('head');
|
||||
}
|
||||
else {
|
||||
container = document.getElementsByTagName('head')[0];
|
||||
}
|
||||
}
|
||||
|
||||
export function createStyleSheet(container: HTMLElement = document.getElementsByTagName('head')[0]): HTMLStyleElement {
|
||||
let style = document.createElement('style');
|
||||
style.type = 'text/css';
|
||||
style.media = 'screen';
|
||||
(container as HTMLElement).appendChild(style);
|
||||
container.appendChild(style);
|
||||
return style;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user