@workday/canvas-kit-react
Version:
The parent module that contains all Workday Canvas Kit React components
55 lines (54 loc) • 1.44 kB
JavaScript
import { buildStyleFns, buildStylePropFn } from './buildStyleFns';
export const backgroundStyleFnConfigs = [
{
name: 'background',
properties: ['background'],
system: 'color',
},
{
name: 'backgroundAttachment',
properties: ['backgroundAttachment'],
system: 'none',
},
{
name: 'backgroundColor',
properties: ['backgroundColor'],
system: 'color',
},
{
name: 'backgroundImage',
properties: ['backgroundImage'],
system: 'none',
},
{
name: 'backgroundPosition',
properties: ['backgroundPosition'],
system: 'none',
},
{
name: 'backgroundRepeat',
properties: ['backgroundRepeat'],
system: 'none',
},
{
name: 'backgroundSize',
properties: ['backgroundSize'],
system: 'none',
},
];
export const backgroundFns = buildStyleFns(backgroundStyleFnConfigs);
/**
* A style prop function that takes component props and returns border styles.
* Some props, such as background and backgroundColor, are connected to our design tokens.
* If no `BackgroundStyleProps` are found, it returns an empty object.
*
* @example
* ```tsx
* const BackgroundExample = () => (
* <Box backgroundColor="blueberry500">
* Hello, background styles!
* </Box>
* );
*```
*/
export const background = buildStylePropFn(backgroundFns);