Skip to content

Commit 00ca02c

Browse files
committed
fix: casing
1 parent 73f7f9f commit 00ca02c

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

src/destructure-line-height.test.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,8 @@ test('lengths with spec-compliant units', () => {
3333
expect.soft(destructure_line_height('1.1px')).toEqual({ value: 1.1, unit: 'px' })
3434
expect.soft(destructure_line_height('100px')).toEqual({ value: 100, unit: 'px' })
3535
expect.soft(destructure_line_height('1e2rem')).toEqual({ value: 100, unit: 'rem' })
36+
expect.soft(destructure_line_height('1REM')).toEqual({ value: 1, unit: 'rem' })
37+
expect.soft(destructure_line_height('1PX')).toEqual({ value: 1, unit: 'px' })
3638
})
3739

3840
test('lenghts with unsupported units', () => {

src/destructure-line-height.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,11 @@ export function destructure_line_height(value: string): Length | number | null {
2323
if (value === 0) {
2424
return 0
2525
}
26-
if (ALLOWED_UNITS.has(maybe_dimension.unit)) {
26+
let unit = maybe_dimension.unit.toLowerCase()
27+
if (ALLOWED_UNITS.has(unit)) {
2728
return {
2829
value,
29-
unit: maybe_dimension.unit as Unit,
30+
unit: unit as Unit,
3031
}
3132
}
3233
return null

0 commit comments

Comments
 (0)