From 463426adb69e5ee6501df466ba6e98de6d59850f Mon Sep 17 00:00:00 2001 From: Mickael Lecoq Date: Mon, 30 Jan 2023 10:32:45 +0100 Subject: [PATCH] fix: gap shorthands should be lowercase (#218) --- README.md | 2 +- src/restyleFunctions.ts | 4 ++-- src/test/createRestyleComponent.test.tsx | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 5cb251f0..0a4a573e 100644 --- a/README.md +++ b/README.md @@ -372,7 +372,7 @@ The Restyle library comes with a number of predefined Restyle functions for your | color | color | colors | | opacity | opacity | _none_ | | visible | display (maps `true` / `false` to `flex` / `none`) | _none_ | -| spacing | margin [m], marginTop [mt], marginRight [mr], marginBottom [mb], marginLeft [ml], marginStart [ms], marginEnd[me], marginHorizontal [mx], marginVertical [my], padding [p], paddingTop [pt], paddingRight [pr], paddingBottom [pb], paddingLeft [pl], paddingStart [ps], paddingEnd [pe], paddingHorizontal [px], paddingVertical [py], gap [g], rowGap [rG], columnGap [cG] | spacing | +| spacing | margin [m], marginTop [mt], marginRight [mr], marginBottom [mb], marginLeft [ml], marginStart [ms], marginEnd[me], marginHorizontal [mx], marginVertical [my], padding [p], paddingTop [pt], paddingRight [pr], paddingBottom [pb], paddingLeft [pl], paddingStart [ps], paddingEnd [pe], paddingHorizontal [px], paddingVertical [py], gap [g], rowGap [rg], columnGap [cg] | spacing | | layout | width, height, minWidth, maxWidth, minHeight, maxHeight, overflow, aspectRatio, alignContent, alignItems, alignSelf, justifyContent, flex, flexBasis, flexDirection, flexGrow, flexShrink, flexWrap | _none_ | | position | position, top, right, bottom, left, start, end | _none_ | | position | zIndex | zIndices | diff --git a/src/restyleFunctions.ts b/src/restyleFunctions.ts index b64b42ae..f4589e1f 100644 --- a/src/restyleFunctions.ts +++ b/src/restyleFunctions.ts @@ -48,8 +48,8 @@ const spacingPropertiesShorthand = { ps: 'paddingStart', pe: 'paddingEnd', g: 'gap', - rG: 'rowGap', - cG: 'columnGap', + rg: 'rowGap', + cg: 'columnGap', }; const typographyProperties = { diff --git a/src/test/createRestyleComponent.test.tsx b/src/test/createRestyleComponent.test.tsx index 7a122f15..d5852658 100644 --- a/src/test/createRestyleComponent.test.tsx +++ b/src/test/createRestyleComponent.test.tsx @@ -211,7 +211,7 @@ describe('createRestyleComponent', () => { it('passes gap shorthands as gap values', () => { const {root} = render( - + , ); expect(root.findByType(View).props).toStrictEqual({