Skip to content
Myr

fix(jsx): add px to numeric gridGap, gridRowGap and gridColumnGap (#5487)

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by Rup Sarmah · committed by GitHub · parent c3053cc · Browse files · 2 files+4 added−1 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

2 files+4 added−1 removed

  • tests:+3 added−0 removed
  • other:+1 added−1 removed

2 files+4 added−1 removed

modified:src/jsx/utils.test.ts+3 added
203 unmodified lines
204 ${'paddingTop'}205 ${'right'}206 ${'top'}207 ${'width'}208 ${'gridGap'}209 ${'gridRowGap'}210 ${'gridColumnGap'}211 `('$property', ({ property }) => {212 const fn = vi.fn()213 styleObjectForEach({ [property]: 1 }, fn)214 expect(fn).toBeCalledWith(
152 unmodified lines
modified:src/jsx/utils.ts+1 added-1 removed
183 unmodified lines
184 }185 let value: string186 if (typeof v === 'number') {187 value = !key.match(188 /^(?:a|border-im|column(?:-c|s)|flex(?:$|-[^b])|grid-(?:ar|[^a])|font-w|li|or|sca|st|ta|wido|z)|ty$/188 /^(?:a|border-im|column(?:-c|s)|flex(?:$|-[^b])|grid-(?!.*gap)(?:ar|[^a])|font-w|li|or|sca|st|ta|wido|z)|ty$/189 )190 ? `${v}px`191 : `${v}`192 } else if (typeof v === 'string') {
10 unmodified lines