@empathyco/x-tailwindcss
Version:
Empathy X Tailwind plugin
45 lines (41 loc) • 1.48 kB
JavaScript
;
var noBackground = require('./utils/no-background.js');
var noHorizontalPadding = require('./utils/no-horizontal-padding.js');
/**
* Returns the `link` variant for component `button`.
*
* @param helpers - The {@link TailwindHelpers} to generate CSS.
* @returns The {@link CssStyleOptions} for the variant.
*/
function buttonLink(helpers) {
const { theme } = helpers;
return {
link: {
display: 'inline-flex',
minHeight: '0',
textDecoration: 'underline',
fontFamily: 'inherit',
fontSize: 'inherit',
lineHeight: 'inherit',
fontWeight: 'inherit',
letterSpacing: 'inherit',
...noHorizontalPadding.noHorizontalPadding(),
...noBackground.noBackground(helpers),
'&.x-selected': {
borderColor: 'transparent',
backgroundColor: 'transparent',
color: `var(--button-color-75,${theme('x.colors.neutral.100')})`,
fontWeight: theme('x.fontWeight.bold'),
'&:hover,&:active': {
borderColor: 'transparent',
backgroundColor: 'transparent',
color: `var(--button-color-50,${theme('x.colors.neutral.90')})`,
},
'&:disabled': {
fontWeight: 'inherit',
},
},
},
};
}
exports.buttonLink = buttonLink;