UNPKG

@empathyco/x-tailwindcss

Version:
45 lines (41 loc) 1.28 kB
'use strict'; var xUtils = require('@empathyco/x-utils'); /** * Returns the `layout-container` dynamic features of component `layout`. * * @param helpers - The {@link TailwindHelpers} to generate CSS. * @returns The {@link CssStyleOptions} for the component. */ function dynamicLayoutContainer(helpers) { const { theme } = helpers; return { ...xUtils.map({ ...xUtils.rename({ mx: (value) => ({ '& > .x-layout-item': { '--x-margin-left': value, '--x-margin-right': value, }, }), ml: (value) => ({ '& > .x-layout-item': { '--x-margin-left': value, }, }), mr: (value) => ({ '& > .x-layout-item': { '--x-margin-right': value, }, }), }, { prefix: 'x-layout-container-' }), }, (name, styles) => { return { styles, values: { ...theme('x.spacing'), }, }; }), }; } exports.dynamicLayoutContainer = dynamicLayoutContainer;