Skip to content

Commit 2c05a4a

Browse files
authored
Merge pull request #1915 from valtism/master
Provide a default tracking with Font Size config
2 parents b565a94 + 07e330d commit 2c05a4a

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

src/plugins/fontSize.js

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,11 @@ export default function() {
44
return function({ addUtilities, e, theme, variants }) {
55
const utilities = _.fromPairs(
66
_.map(theme('fontSize'), (value, modifier) => {
7-
const [fontSize, lineHeight] = Array.isArray(value) ? value : [value]
7+
const [fontSize, options] = Array.isArray(value) ? value : [value]
8+
// Tailwind 1.3+ syntax allowed line height to be specified in the array like
9+
// ['16px', '24px'], so we can get it from there as well as from object syntax
10+
const lineHeight = options instanceof Object ? options.lineHeight : options
11+
const letterSpacing = options && options.letterSpacing
812

913
return [
1014
`.${e(`text-${modifier}`)}`,
@@ -15,6 +19,11 @@ export default function() {
1519
: {
1620
'line-height': lineHeight,
1721
}),
22+
...(letterSpacing === undefined
23+
? {}
24+
: {
25+
'letter-spacing': letterSpacing,
26+
}),
1827
},
1928
]
2029
})

0 commit comments

Comments
 (0)