Skip to content

Commit

Permalink
chore: update line test
Browse files Browse the repository at this point in the history
  • Loading branch information
Simon-He95 committed Mar 22, 2024
1 parent fe0d0a5 commit e613060
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/line.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import { getVal, transformImportant } from './utils'

const lineMap = {
const lineMap: Record<string, string> = {
1: 'none',
1.25: 'tight',
1.375: 'snug',
1.5: 'normal',
1.625: 'relaxed',
2: 'loose'
2: 'loose',
}
export function line(key: string, val: string) {
const [value, important] = transformImportant(val)
Expand Down
4 changes: 4 additions & 0 deletions test/line.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,10 @@ describe('line-height', () => {
expect(toUnocss('line-height: 1.625;')).toBe('lh-relaxed')
})

it('line-height: 2', () => {
expect(toUnocss('line-height: 2;')).toBe('lh-loose')
})

it('calc', () => {
expect(toUnocss('line-height: calc(100% - 20px);')).toBe(
'lh="[calc(100%-20px)]"',
Expand Down

0 comments on commit e613060

Please sign in to comment.