MCPcopy
hub / github.com/microsoft/SandDance / loadTheme

Function loadTheme

docs/app/js/sanddance-app.js:26959–26974  ·  view source on GitHub ↗
(theme, depComments)

Source from the content-addressed store, hash-verified

26957 _onThemeChangeCallbacks.splice(i, 1);
26958}
26959function 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

Callers 1

Calls 4

_loadFontsFunction · 0.85
reloadStylesFunction · 0.85
callbackFunction · 0.70
forEachMethod · 0.45

Tested by

no test coverage detected