No more need to use monacoShadowRoot in createStyleSheet because all standalone editor calls are qualified

This commit is contained in:
Alex Dima
2020-01-19 22:04:39 +01:00
parent 4b88d52839
commit bb73c423a8

View File

@@ -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;
}