(content: string, name: string, value = "", theme?: string)
| 14 | }; |
| 15 | |
| 16 | const createStyle = (content: string, name: string, value = "", theme?: string) => { |
| 17 | const currentRuntimeIndex = getCurrentRuntimeIndex(); |
| 18 | |
| 19 | const stylesheet = new CSSStyleSheet(); |
| 20 | stylesheet.replaceSync(content); |
| 21 | (stylesheet as Record<string, any>)._ui5StyleId = getStyleId(name, value); // set an id so that we can find the style later |
| 22 | if (theme) { |
| 23 | (stylesheet as Record<string, any>)._ui5RuntimeIndex = currentRuntimeIndex; |
| 24 | (stylesheet as Record<string, any>)._ui5Theme = theme; |
| 25 | } |
| 26 | document.adoptedStyleSheets = [...document.adoptedStyleSheets, stylesheet]; |
| 27 | }; |
| 28 | |
| 29 | const updateStyle = (content: string, name: string, value = "", theme?: string) => { |
| 30 | if (isSSR) { |
no test coverage detected
searching dependent graphs…