(theme, depComments)
| 26957 | _onThemeChangeCallbacks.splice(i, 1); |
| 26958 | } |
| 26959 | function loadTheme(theme, depComments) { |
| 26960 | var _a; |
| 26961 | if (depComments === void 0) depComments = false; |
| 26962 | _theme = (0, _createTheme.createTheme)(theme, depComments); |
| 26963 | // Invoke the legacy method of theming the page as well. |
| 26964 | (0, _loadThemedStyles.loadTheme)((0, _tslib.__assign)((0, _tslib.__assign)((0, _tslib.__assign)((0, _tslib.__assign)({}, _theme.palette), _theme.semanticColors), _theme.effects), _loadFonts(_theme))); |
| 26965 | (0, _utilities.Customizations).applySettings((_a = {}, _a[ThemeSettingName] = _theme, _a)); |
| 26966 | _onThemeChangeCallbacks.forEach(function(callback) { |
| 26967 | try { |
| 26968 | callback(_theme); |
| 26969 | } catch (e) { |
| 26970 | // don't let a bad callback break everything else |
| 26971 | } |
| 26972 | }); |
| 26973 | return _theme; |
| 26974 | } |
| 26975 | /** |
| 26976 | * Loads font variables into a JSON object. |
| 26977 | * @param theme - The theme object |
no test coverage detected