Skip to content

Commit

Permalink
feat(preset-mini): add line-height utility (#2521)
Browse files Browse the repository at this point in the history
  • Loading branch information
sibbng committed Apr 20, 2023
1 parent 75ed63d commit e833ae4
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
4 changes: 2 additions & 2 deletions packages/preset-mini/src/_rules/typography.ts
Expand Up @@ -72,9 +72,9 @@ export const fonts: Rule<Theme>[] = [

// leadings
[
/^(?:font-)?(?:leading|lh)-(.+)$/,
/^(?:font-)?(?:leading|lh|line-height)-(.+)$/,
([, s], { theme }) => ({ 'line-height': handleLineHeight(s, theme) }),
{ autocomplete: '(leading|lh)-$lineHeight' },
{ autocomplete: '(leading|lh|line-height)-$lineHeight' },
],

// synthesis
Expand Down
3 changes: 2 additions & 1 deletion test/assets/output/preset-mini-targets.css
Expand Up @@ -351,7 +351,8 @@ unocss .scope-\[unocss\]\:block{display:block;}
.leading-\$variable,
.lh-\$variable{line-height:var(--variable);}
.leading-inherit{line-height:inherit;}
.lh-\[1\.5\]{line-height:1.5;}
.lh-\[1\.5\],
.line-height-\[1\.5\]{line-height:1.5;}
.font-synthesis-weight{font-synthesis:weight;}
.font-synthesis-small-caps{font-synthesis:small-caps;}
.font-synthesis-\[weight_style\]{font-synthesis:weight style;}
Expand Down
1 change: 1 addition & 0 deletions test/assets/preset-mini-targets.ts
Expand Up @@ -815,6 +815,7 @@ export const presetMiniTargets: string[] = [
'leading-inherit',
'font-leading-2',
'lh-[1.5]',
'line-height-[1.5]',
'tracking-wide',
'tracking-[2/5]',
'tracking-inherit',
Expand Down

0 comments on commit e833ae4

Please sign in to comment.