rebass-preset 5.0.0
Install from the command line:
Learn more about npm packages
$ npm install @streetwriters/rebass-preset@5.0.0
Install via package.json:
"@streetwriters/rebass-preset": "5.0.0"
About this version
Base theme preset for use with Rebass
npm i @rebass/preset
For general usage with Emotion, pass the theme preset to Emotion's ThemeProvider
component at the root of your application.
import React from 'react'
import { ThemeProvider } from 'emotion-theming'
import theme from '@rebass/preset'
export default props =>
<ThemeProvider theme={theme}>
{props.children}
</ThemeProvider>
For use with Theme UI, import the ThemeProvider
from theme-ui
.
import { ThemeProvider } from 'theme-ui'
Or, if you're using gatsby-plugin-theme-ui
, export the theme from src/gatsby-plugin-theme-ui/index.js
.
// src/gatsby-plugin-theme-ui/index.js
import preset from '@rebass/preset'
export default {
...preset
}
The base theme object can be customized by using either deepmerge
or lodash.merge
to deeply merge objects.
import merge from 'lodash.merge'
import preset from '@rebass/preset'
export default merge(preset, {
colors: {
// custom primary color
primary: 'tomato',
}
})
Details
- rebass-preset
-
streetwriters
- over 2 years ago
- MIT
- 2 dependencies
Assets
- rebass-preset-5.0.0.tgz
Download activity
- Total downloads 0
- Last 30 days 0
- Last week 0
- Today 0