Add test coverage for default letter-spacing feature

This commit is contained in:
Adam Wathan 2020-08-06 15:42:52 -04:00
parent 2c05a4a633
commit a7c410656d
2 changed files with 61 additions and 4 deletions

View file

@ -5,10 +5,11 @@ export default function() {
const utilities = _.fromPairs(
_.map(theme('fontSize'), (value, modifier) => {
const [fontSize, options] = Array.isArray(value) ? value : [value]
// Tailwind 1.3+ syntax allowed line height to be specified in the array like
// ['16px', '24px'], so we can get it from there as well as from object syntax
const lineHeight = options instanceof Object ? options.lineHeight : options
const letterSpacing = options && options.letterSpacing
const { lineHeight, letterSpacing } = _.isPlainObject(options)
? options
: {
lineHeight: options,
}
return [
`.${e(`text-${modifier}`)}`,