Skip to content

Commit

Permalink
fix(preset-mini): fix non-existent font-size, still return `line-he…
Browse files Browse the repository at this point in the history
…ight`. (#2160)
  • Loading branch information
Dunqing committed Feb 6, 2023
1 parent fff0699 commit 857a314
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
5 changes: 3 additions & 2 deletions packages/preset-mini/src/_rules/typography.ts
Expand Up @@ -44,9 +44,10 @@ export const fonts: Rule<Theme>[] = [
}
}

if (lineHeight) {
const fontSize = h.bracketOfLength.rem(size)
if (lineHeight && fontSize) {
return {
'font-size': h.bracketOfLength.rem(size),
'font-size': fontSize,
'line-height': lineHeight,
}
}
Expand Down
3 changes: 3 additions & 0 deletions test/assets/preset-mini-targets.ts
Expand Up @@ -1092,4 +1092,7 @@ export const presetMiniNonTargets = [
'[Baz::class]',
// escaped arbitrary css properties only allowed in css variables
'[cant\~escape:me]',

// not exists
'text-main/50',
]

0 comments on commit 857a314

Please sign in to comment.