@empathyco/x-tailwindcss
Version:
Empathy X Tailwind plugin
30 lines (27 loc) • 1.03 kB
JavaScript
import { deepMerge } from '@empathyco/x-deep-merge';
import { noBackground } from './utils/no-background.js';
import { noHorizontalPadding } from './utils/no-horizontal-padding.js';
/**
* Returns the `tight` variant for component `button`.
*
* @param helpers - The {@link TailwindHelpers} to generate CSS.
* @returns The {@link CssStyleOptions} for the variant.
*/
function buttonTight(helpers) {
const { theme } = helpers;
return {
tight: deepMerge(noBackground(helpers), noHorizontalPadding(), {
'&.x-selected': {
borderColor: 'transparent',
backgroundColor: 'transparent',
color: `var(--button-color-75,${theme('x.colors.neutral.100')})`,
'&:hover,&:active': {
borderColor: 'transparent',
backgroundColor: 'transparent',
color: `var(--button-color-50,${theme('x.colors.neutral.90')})`,
},
},
}),
};
}
export { buttonTight };