@indielayer/ui
Version:
Indielayer UI Components with Tailwind CSS build for Vue 3
30 lines (22 loc) • 1.01 kB
text/typescript
import type { TableCellTheme } from '../TableCell.vue'
const theme: TableCellTheme = {
classes: {
wrapper: ({ props }) => {
const c = ['last:pr-0 px-3']
c.push(props.dense ? 'py-2' : 'py-4')
if (props.textAlign === 'left') c.push('text-left')
else if (props.textAlign === 'center') c.push('text-center')
else if (props.textAlign === 'right') c.push('text-right')
else if (props.textAlign === 'justify') c.push('text-justify')
if (props.verticalAlign === 'baseline') c.push('align-baseline')
else if (props.verticalAlign === 'bottom') c.push('align-bottom')
else if (props.verticalAlign === 'middle') c.push('align-middle')
else if (props.verticalAlign === 'text-bottom') c.push('align-text-bottom')
else if (props.verticalAlign === 'text-top') c.push('align-text-top')
else if (props.verticalAlign === 'top') c.push('align-top')
if (props.truncate) c.push('truncate')
return c
},
},
}
export default theme