@empathyco/x-tailwindcss
Version:
Empathy X Tailwind plugin
19 lines (16 loc) • 527 B
JavaScript
import { rename, map } from '@empathyco/x-utils';
/**
* Returns the `max width` variants of component `layout`.
*
* @param helpers - The {@link TailwindHelpers} to generate CSS.
* @returns The {@link CssStyleOptions} for the component.
*/
function maxWidth(helpers) {
const { theme } = helpers;
return {
'max-width': rename(map(theme('x.layoutMaxWidth'), (maxWidthName, maxWidthValue) => ({
'--x-layout-max-width': maxWidthValue,
})), { prefix: '&-' }),
};
}
export { maxWidth };