Skip to content

Instantly share code, notes, and snippets.

@jps
Last active February 5, 2021 11:45
Show Gist options
  • Select an option

  • Save jps/dd4f0119f0141d9d3de9e0ceab040219 to your computer and use it in GitHub Desktop.

Select an option

Save jps/dd4f0119f0141d9d3de9e0ceab040219 to your computer and use it in GitHub Desktop.
component defaults example of Newskit button for blog
//Declare our custom theme
const myCustomTheme = createTheme({
name: 'newskit-component-defaults-change',
overrides: {
componentDefaults: {
button: {
medium: {
typographyPreset: 'utilityButton010',
stylePreset: 'buttonOutlinedPrimary',
},
},
}
},
});
//Wrap in our custom theme provider
<ThemeProvider theme={myCustomTheme}>
<Button>Button Stlyed through component defaults</Button>
<Button overrides={{stylePreset:'buttonSolidPrimary'}} >
Can still apply overrides over defaults
</Button>
</ThemeProvider>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment