2 ms·
You can share style portions at the component level.. you can bring in portions of style definitions from the parent or even the theme level... import base
by tracker1 8y ago
You can share style portions at the component level.. you can bring in portions of style definitions from the parent or even the theme level...
import baseStyles from './section.styles.js';
const styles = theme({
baseline: {
...theme.components.foo,
...baseStyles.foo,
// customizations here
},
variantState: {
// dynamically controlled style alterations for
// a different state
...baseStyles.variantState
},
});
You can totally reuse styles, it's just controlled at the component level. Beyond this, options for the theme itself can be injected by default, release, application settings in the app, and user configurable settings in the application.
export theme = async () => {
const {env, app, user} = getThemes();
return deepMerge(base.theme, env, app, user);
};