tailwindcss/src/plugins/textOverflow.js

23 lines
606 B
JavaScript
Raw Normal View History

import { flagEnabled } from '../featureFlags'
2020-10-16 13:30:06 -04:00
export default function () {
return function ({ addUtilities, variants, config }) {
addUtilities(
{
...(flagEnabled(config(), 'moveTruncateToTextOverflow')
? {
'.truncate': {
overflow: 'hidden',
'text-overflow': 'ellipsis',
'white-space': 'nowrap',
},
}
: {}),
'.overflow-ellipsis': { 'text-overflow': 'ellipsis' },
'.overflow-clip': { 'text-overflow': 'clip' },
},
variants('textOverflow')
)
}
}