Plugins: return a promise for loadPluginCss (#18273)

This commit is contained in:
Ryan McKinley 2019-07-29 21:14:34 -07:00 committed by GitHub
parent 4ce814ba94
commit 7949329636
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -10,10 +10,7 @@ export interface PluginCssOptions {
export const SystemJS = System;
export function loadPluginCss(options: PluginCssOptions) {
if (config.bootData.user.lightTheme) {
SystemJS.import(`${options.light}!css`);
} else {
SystemJS.import(`${options.dark}!css`);
}
export function loadPluginCss(options: PluginCssOptions): Promise<any> {
const theme = config.bootData.user.lightTheme ? options.light : options.dark;
return SystemJS.import(`${theme}!css`);
}