diff --git a/src/line.ts b/src/line.ts index a51ffc1..77302e9 100644 --- a/src/line.ts +++ b/src/line.ts @@ -1,12 +1,12 @@ import { getVal, transformImportant } from './utils' -const lineMap = { +const lineMap: Record = { 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) diff --git a/test/line.test.ts b/test/line.test.ts index 90c366e..b89657b 100644 --- a/test/line.test.ts +++ b/test/line.test.ts @@ -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)]"',