From 01776845acb939240f5da32782e3af66de7ae591 Mon Sep 17 00:00:00 2001 From: Evan Jacobs Date: Thu, 29 Oct 2026 18:37:15 +0000 Subject: [PATCH 1/2] docs: correct README examples to match current output The transform example listed functions in CSS source order. The parser prepends each function, so scale comes before translate. The border-radius note named borderTopLeft instead of borderTopLeftRadius. The font shorthand example now uses the key order the function returns. --- README.md | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index f49bdf8..9a3b2d5 100644 --- a/README.md +++ b/README.md @@ -32,11 +32,11 @@ transform: translate(10px, 5px) scale(5); { textShadowOffset: { width: 10, height: 5 }, fontVariant: ['small-caps'], - // Fixes backwards transform order + // The list is reversed from the CSS source order: each function is prepended. transform: [ + { scale: 5 }, { translateY: 5 }, { translateX: 10 }, - { scale: 5 }, ] } ``` @@ -50,11 +50,11 @@ margin: 5px 7px 2px; ```js { - fontFamily: 'Helvetica', - fontSize: 14, - fontWeight: 'bold', fontStyle: 'normal', + fontWeight: 'bold', fontVariant: [], + fontSize: 14, + fontFamily: 'Helvetica', lineHeight: 16, marginTop: 5, marginRight: 7, @@ -158,7 +158,8 @@ Should you wish to opt-out of transforming certain shorthands, an array of prope ```js transform([['border-radius', '50px']], ['borderRadius']); -// { borderRadius: 50 } rather than { borderTopLeft: ... } +// { borderRadius: 50 } rather than +// { borderTopLeftRadius: 50, borderTopRightRadius: 50, borderBottomRightRadius: 50, borderBottomLeftRadius: 50 } ``` This can also be done by passing a third argument, `false` to `getStylesForProperty`. From d6e3b78662166bb9833a997c5e35c09ecdd908ab Mon Sep 17 00:00:00 2001 From: Evan Jacobs Date: Thu, 29 Oct 2026 20:22:00 +0000 Subject: [PATCH 2/2] docs: list font and flex-flow keys in return order The shorthand table still listed lineHeight before fontFamily, and flexDirection before flexWrap. Both functions return the other order. --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 9a3b2d5..33cb749 100644 --- a/README.md +++ b/README.md @@ -100,8 +100,8 @@ following shorthand and special-case transforms: | `border-radius` | `borderTopLeftRadius`, `borderTopRightRadius`, `borderBottomRightRadius`, `borderBottomLeftRadius` | | `border-width` | `borderTopWidth`, `borderRightWidth`, `borderBottomWidth`, `borderLeftWidth` | | `flex` | `flexGrow`, `flexShrink`, `flexBasis` | -| `flex-flow` | `flexDirection`, `flexWrap` | -| `font` | `fontStyle`, `fontWeight`, `fontVariant`, `fontSize`, `lineHeight`, `fontFamily` | +| `flex-flow` | `flexWrap`, `flexDirection` | +| `font` | `fontStyle`, `fontWeight`, `fontVariant`, `fontSize`, `fontFamily`, `lineHeight` | | `font-family` | `fontFamily` | | `font-variant` | `fontVariant` | | `font-weight` | `fontWeight` |