diff options
Diffstat (limited to 'src/Utils.ts')
-rw-r--r-- | src/Utils.ts | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/Utils.ts b/src/Utils.ts index 39fc3dae4..c7074c3da 100644 --- a/src/Utils.ts +++ b/src/Utils.ts @@ -500,9 +500,9 @@ export function addStyleSheet(styleType: string = "text/css") { const sheets = document.head.appendChild(style); return (sheets as any).sheet; } -export function addStyleSheetRule(sheet: any, selector: any, css: any) { +export function addStyleSheetRule(sheet: any, selector: any, css: any, selectorPrefix = ".") { const propText = typeof css === "string" ? css : Object.keys(css).map(p => p + ":" + (p === "content" ? "'" + css[p] + "'" : css[p])).join(";"); - return sheet.insertRule("." + selector + "{" + propText + "}", sheet.cssRules.length); + return sheet.insertRule(selectorPrefix + selector + "{" + propText + "}", sheet.cssRules.length); } export function removeStyleSheetRule(sheet: any, rule: number) { if (sheet.rules.length) { |