18 lines
574 B
JavaScript
18 lines
574 B
JavaScript
import _ from 'lodash'
|
|
import flattenColorPalette from '../util/flattenColorPalette'
|
|
import withAlphaVariable from '../util/withAlphaVariable'
|
|
|
|
export default function() {
|
|
return function({ addUtilities, e, theme, variants }) {
|
|
const utilities = _.fromPairs(
|
|
_.map(flattenColorPalette(theme('textColor')), (value, modifier) => {
|
|
return [
|
|
`.${e(`text-${modifier}`)}`,
|
|
withAlphaVariable({ color: value, property: 'color', variable: '--text-opacity' }),
|
|
]
|
|
})
|
|
)
|
|
|
|
addUtilities(utilities, variants('textColor'))
|
|
}
|
|
}
|