benefit exposes the methods used to build its own default configuration. You have the option of keeping as much or as little as you want of it. Similar to how you would override a webpack config in other tools, just supply a function that will return your configuration.
jsconst myConfig = config => {/* modify existing config and return */}
Your configuration function can be passed into the benefit function...
jsimport benefit from "benefit"const myConfig = config => {/* modify existing config and return */}const { styleWith } = benefit(myConfig)// styleWith is now capable of parsing/injecting any custom utilities that you have created
...or into a react ConfigProvider.
jsimport { ConfigProvider } from "benefit/react"const myConfig = config => {/* modify existing config and return */}const App = () => (<ConfigProvider config={myConfig}>{/* Use any utility classes within here */}</ConfigProvider>)
The configuration function will be passed in the default configuration should you need to borrow any values to compose with.
The config object has the following shape:
js{// This prefix will prepend all utility class namesprefix: "",theme: {},normalize: (theme) => ({}),utilities: [(theme) => ({}), (theme) => ({}), ...],variants: [(utilities, theme) => ({}), (utilities, theme) => ({}), ...],apply: {}}