diff --git a/common/changes/@uifabric/merge-styles/async-style_2018-04-16-22-29.json b/common/changes/@uifabric/merge-styles/async-style_2018-04-16-22-29.json new file mode 100644 index 00000000000000..b37b1d11d11c00 --- /dev/null +++ b/common/changes/@uifabric/merge-styles/async-style_2018-04-16-22-29.json @@ -0,0 +1,11 @@ +{ + "changes": [ + { + "packageName": "@uifabric/merge-styles", + "comment": "mergeStyles: rules are now registered in separate styling objects, improving performance significantly.", + "type": "patch" + } + ], + "packageName": "@uifabric/merge-styles", + "email": "dzearing@microsoft.com" +} \ No newline at end of file diff --git a/packages/merge-styles/src/Stylesheet.ts b/packages/merge-styles/src/Stylesheet.ts index 12de4f0d2f5b2c..c3b1a87a52ee63 100644 --- a/packages/merge-styles/src/Stylesheet.ts +++ b/packages/merge-styles/src/Stylesheet.ts @@ -215,6 +215,11 @@ export class Stylesheet { private _getElement(): HTMLStyleElement | undefined { if (!this._styleElement && typeof document !== 'undefined') { this._styleElement = _createStyleElement(); + + // Reset the style element on the next frame. + window.requestAnimationFrame(() => { + this._styleElement = undefined; + }); } return this._styleElement; }