const plugin = require('tailwindcss/plugin');

const flexCenterBaseStyles = {
  display: 'flex',
  'justify-content': 'center',
  'align-items': 'center',
};

/** flex 居中 */
const flexCenter = plugin(function ({ addUtilities }) {
  addUtilities({
    /** flex 居中 */
    '.flex-row-center': flexCenterBaseStyles,
    '.flex-col-center': { ...flexCenterBaseStyles, 'flex-direction': 'column' },
    '.layout-menu': {},
    '.scrollbar': {},
    '.card': {},
    '.card-title': {},
    '.card-subtitle': {},
    '.card-body': {},
    '.card-footer': {},
    '.card-key': {},
  });
});

module.exports = flexCenter;
