Skip to content

Commit

Permalink
feat(global): add ability to customize global css
Browse files Browse the repository at this point in the history
  • Loading branch information
zouxuoz committed Dec 28, 2018
1 parent c010e8d commit 9233991
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/EightBaseBoostProvider.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
// @flow

import React from 'react';
import { injectGlobal } from 'emotion';
import { ThemeProvider } from 'emotion-theming';
import { IconsProvider } from './components/Icon/IconsProvider';
import { ModalProvider } from './components/Modal/ModalProvider';
Expand All @@ -23,6 +24,12 @@ class EightBaseBoostProvider extends React.Component<EightBaseBoostProviderProps

componentDidMount() {
resetGlobal(this.theme);

Object.keys(this.theme.components).forEach((name) => {
if (this.theme.components[name].globals) {
injectGlobal(this.theme.components[name].globals);
}
});
}

render() {
Expand Down

0 comments on commit 9233991

Please sign in to comment.