(theme: string)
| 59 | }; |
| 60 | |
| 61 | const detectExternalTheme = async (theme: string) => { |
| 62 | // If theme designer theme is detected, use this |
| 63 | const extTheme = getThemeDesignerTheme(); |
| 64 | if (extTheme) { |
| 65 | return extTheme; |
| 66 | } |
| 67 | |
| 68 | // If OpenUI5Support is enabled, try to find out if it loaded variables |
| 69 | const openUI5Support = getFeature<typeof OpenUI5Support>("OpenUI5Support"); |
| 70 | if (openUI5Support && openUI5Support.isOpenUI5Detected()) { |
| 71 | const varsLoaded = openUI5Support.cssVariablesLoaded(); |
| 72 | if (varsLoaded) { |
| 73 | return { |
| 74 | themeName: openUI5Support.getConfigurationSettingsObject()?.theme, // just themeName |
| 75 | baseThemeName: "", // baseThemeName is only relevant for custom themes |
| 76 | }; |
| 77 | } |
| 78 | } else if (getThemeRoot()) { |
| 79 | await attachCustomThemeStylesToHead(theme); |
| 80 | |
| 81 | return getThemeDesignerTheme(); |
| 82 | } |
| 83 | }; |
| 84 | |
| 85 | const applyTheme = async (theme: string) => { |
| 86 | const extTheme = await detectExternalTheme(theme); |
no test coverage detected
searching dependent graphs…