You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
chore(v7): trim docs duplication, fix stale gradient/filter/@supports claims (#1004)
* chore(v7): trim docs duplication, fix stale gradient/filter/@supports claims
- whats-new: tighten Highlights bullets, link out to native + plugins sections
instead of restating their content; drop the disableCSSOMInjection mention
that appeared in both Highlights and Removed.
- migration: collapse the dedicated rscPlugin / rtlPlugin / SCPlugin sections
into a single pointer at the plugins page; defer native specifics to
native.mdx and the compatibility matrix.
- native: qualify hover with the RN 0.85 feature-flag default, flag the
conic-gradient gap and platform-conditional filter / blend-mode / skew rows
in Limitations.
- cssCompat: add @supports row. The native parser routes its condition through
the same evaluator as @media / @container, which only understands media
features, so feature-test conditions never gate anything on native and the
inner block always applies.
- Bump styled-components prerelease to 20260513034901.
* docs(v7): break long hover feature-flag id out of inline code
ReactNativeFeatureFlags.shouldPressibilityUseW3CPointerEventsForHover was
overflowing the docs column. Move it into a small fenced code block that
also shows users how to actually flip the flag.
* docs(v7): drop the duplicated Removed-in-v7 list and sweep em-dashes
Each Removed bullet in whats-new.mdx restated the matching section in the
migration guide, so the section was pure duplication. Removed it; readers
land on Highlights and then the migration guide directly below.
Em-dash sweep: kept one in migration.mdx where it punctuates naturally,
swapped the rest to colons (in name: description bullets) or semicolons /
periods elsewhere.
---------
Co-authored-by: Claude <noreply@anthropic.com>
Copy file name to clipboardExpand all lines: sections/v7/migration.mdx
+8-43Lines changed: 8 additions & 43 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -46,68 +46,33 @@ The result is plain CSS, safe to inject into another document via `innerHTML`. T
46
46
47
47
The runtime vendor prefixer has been removed. For the properties that still need prefixing on older Safari (`backdrop-filter`, `mask`, `user-select`), declare both the prefixed and unprefixed forms in your CSS, or run a build-time PostCSS transform.
48
48
49
-
### `stylisPluginRSC` moved to a subpath
49
+
### Plugins moved to a subpath
50
50
51
-
The top-level export has been removed. Import from `styled-components/plugins`instead, and pass via the renamed `plugins` prop:
51
+
`stylisPluginRSC` and the v6 `stylisPlugins` prop are gone. Import the first-party plugins from `styled-components/plugins` and pass them via the renamed `plugins` prop:
52
52
53
53
```diff
54
54
-import { stylisPluginRSC } from 'styled-components';
55
-
+import { rscPlugin } from 'styled-components/plugins';
55
+
+import { rscPlugin, rtlPlugin } from 'styled-components/plugins';
// `rw` runs on every fully-resolved selector after `&` substitution and
85
-
// namespace prepending. Return a new selector string.
86
-
rw: selector=>`.app ${selector}`,
87
-
// `decl` runs on every emitted `prop: value` pair. Return `{ prop, value }`
88
-
// to rewrite, or `undefined` to leave the pair unchanged.
89
-
decl: (prop, value) => ({ prop, value }),
90
-
};
91
-
```
92
-
93
-
Legacy stylis function plugins don't run in v7 because they don't expose `rw` or `decl`. Production builds ignore them; development builds warn once per unrecognized plugin name.
61
+
`stylis-plugin-rtl` is replaced by the first-party `rtlPlugin`. Custom stylis plugins authored against the v6 middleware contract no longer load and must port to the new `SCPlugin` shape. See [Plugins moved to a dedicated subpath](#plugins-moved-to-a-dedicated-subpath) for details and authoring guidance.
94
62
95
63
### Global styles emit once per component
96
64
97
65
`createGlobalStyle` components now emit their CSS once even if you mount the same component multiple times. If your app deliberately remounts the same global to re-apply styles, that pattern no longer works; mount once per global rule set.
98
66
99
67
### React Native bumps and changes
100
68
101
-
The [CSS Compatibility matrix](/docs/compatibility) is the per-feature source of truth for what changed between v6 and v7 on web and native; the list below covers the most common cases.
102
-
103
-
If you're on React Native:
69
+
The [CSS Compatibility matrix](/docs/compatibility) is the per-feature source of truth for what changed between v6 and v7 on web and native. The most common gotchas:
104
70
105
71
- The peer floor moves to RN ≥ 0.85.
106
-
- The `lab()`, `lch()`, `oklab()`, `oklch()`, and `color-mix()` notations now resolve to displayable colors with hue-preserving gamut mapping. Wide-gamut inputs that fall outside sRGB land at the closest in-gamut color.
107
-
-`transform: matrix(...)` / `matrix3d(...)` and bare-number `translateX(N)` work on native.
108
-
-`linear-gradient(...)`, `radial-gradient(...)`, and the full `filter` chain (`blur`, `saturate`, `hue-rotate`, ...) work on native. iOS apps need `ReactNativeReleaseLevel: experimental` in `Info.plist` to enable the SwiftUI filter backend for `blur` / `saturate` / `hue-rotate` / `grayscale` / `contrast` / `drop-shadow`. `brightness` and `opacity` work without it.
109
72
-`border: none` now emits `border-style: none` (previously `solid`, which produced surprising hairlines).
110
-
-`transition`, `@keyframes`, and `@starting-style` all animate on the native thread by default — no extra import, peer dependency, or configuration. If you prefer to drive animations through reanimated 4's CSS layer, opt in once at your app entry with `import 'styled-components/native/reanimated'`; `react-native-reanimated@^4` becomes a peer dependency only in that case.
73
+
- The optional reanimated adapter is opt-in at app entry: `import 'styled-components/native/reanimated'`. `react-native-reanimated@^4` becomes a peer dependency only in that case. The adapter is experimental and not heavily tested yet; the default `Animated`-based adapter runs without any setup.
74
+
75
+
[React Native gets modern CSS](#react-native-gets-modern-css) walks through the new surface (modern color spaces, gradients, filters, selectors, animations, `createTheme()`) and calls out the platform-level caveats — iOS SwiftUI filter opt-in, hover feature flag, conic-gradient gap, and the rest. The compatibility matrix has the per-feature breakdown.
0 commit comments