Generate CSS custom properties for use with Theme UI.
npm i @theme-ui/custom-properties
Transform your Theme UI compliant theme config with the library:
const toCustomProperties = require('@theme-ui/custom-properties')
const theme = require('../theme')
module.exports = () => {
const customProperties = toCustomProperties(theme, '🍭')
return customProperties
}
The @theme-ui/custom-properties function takes two parameters:
toCustomProperties($theme, $prefix)
- theme - The theme ui specification object
- prefix - An optional prefix for the css custom property optional