MCPcopy
hub / github.com/microsoft/rushstack / applyThemableStyles

Function applyThemableStyles

src/index.ts:95–104  ·  view source on GitHub ↗

* Loads a set of style text. If it is registered too early, we will register it when the window.load event * is fired. * @param {string} styleText Style to register. * @param {IStyleRecord} styleRecord Existing style record to re-apply.

(stylesArray: ThemableArray, styleRecord?: IStyleRecord)

Source from the content-addressed store, hash-verified

93 * @param {IStyleRecord} styleRecord Existing style record to re-apply.
94 */
95function applyThemableStyles(stylesArray: ThemableArray, styleRecord?: IStyleRecord): void {
96 if (_themeState.loadStyles) {
97 const styles: string = resolveThemableArray(stylesArray);
98 _themeState.loadStyles(styles);
99 } else {
100 _injectStylesWithCssText ?
101 registerStylesIE(stylesArray, styleRecord) :
102 registerStyles(stylesArray, styleRecord);
103 }
104}
105
106/**
107 * Registers a set theme tokens to find and replace. If styles were already registered, they will be

Callers 2

loadStylesFunction · 0.85
reloadStylesFunction · 0.85

Calls 3

resolveThemableArrayFunction · 0.85
registerStylesIEFunction · 0.85
registerStylesFunction · 0.85

Tested by

no test coverage detected