Skip to content

Commit

Permalink
fix: gap shorthands should be lowercase (#218)
Browse files Browse the repository at this point in the history
  • Loading branch information
mlecoq authored Jan 30, 2023
1 parent 11a9812 commit 463426a
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 |
Expand Down
4 changes: 2 additions & 2 deletions src/restyleFunctions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,8 @@ const spacingPropertiesShorthand = {
ps: 'paddingStart',
pe: 'paddingEnd',
g: 'gap',
rG: 'rowGap',
cG: 'columnGap',
rg: 'rowGap',
cg: 'columnGap',
};

const typographyProperties = {
Expand Down
2 changes: 1 addition & 1 deletion src/test/createRestyleComponent.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ describe('createRestyleComponent', () => {
it('passes gap shorthands as gap values', () => {
const {root} = render(
<ThemeProvider theme={theme}>
<Component g="s" cG="s" rG="s" />
<Component g="s" cg="s" rg="s" />
</ThemeProvider>,
);
expect(root.findByType(View).props).toStrictEqual({
Expand Down

0 comments on commit 463426a

Please sign in to comment.