mirror of
https://github.com/tailwindlabs/tailwindcss.git
synced 2025-12-08 21:36:08 +00:00
26 lines
619 B
JavaScript
26 lines
619 B
JavaScript
import _ from 'lodash'
|
|
|
|
export default function() {
|
|
return function({ addUtilities, e, theme, variants }) {
|
|
const utilities = _.fromPairs(
|
|
_.map(theme('fontSize'), (value, modifier) => {
|
|
const [fontSize, lineHeight] = Array.isArray(value) ? value : [value]
|
|
|
|
return [
|
|
`.${e(`text-${modifier}`)}`,
|
|
{
|
|
'font-size': fontSize,
|
|
...(lineHeight === undefined
|
|
? {}
|
|
: {
|
|
'line-height': lineHeight,
|
|
}),
|
|
},
|
|
]
|
|
})
|
|
)
|
|
|
|
addUtilities(utilities, variants('fontSize'))
|
|
}
|
|
}
|