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
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.
Copy file name to clipboardExpand all lines: sections/v7/migration.mdx
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -70,7 +70,7 @@ The [CSS Compatibility matrix](/docs/compatibility) is the per-feature source of
70
70
71
71
- The peer floor moves to RN ≥ 0.85.
72
72
-`border: none` now emits `border-style: none` (previously `solid`, which produced surprising hairlines).
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.
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
74
75
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.
Copy file name to clipboardExpand all lines: sections/v7/native.mdx
+12-12Lines changed: 12 additions & 12 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -19,7 +19,7 @@ const Card = styled.View`
19
19
`;
20
20
```
21
21
22
-
-**Math functions**: `calc()`, `clamp()`, `min()`, `max()`, plus the full CSS Values 4 Math L4 family — `round()`, `mod()`, `rem()`, `sin`, `cos`, `tan`, `asin`, `acos`, `atan`, `atan2`, `pow`, `sqrt`, `hypot`, `log`, `exp`, `abs`, `sign`. Constants `pi` and `e` resolve in any context.
22
+
-**Math functions**: `calc()`, `clamp()`, `min()`, `max()`, plus the full CSS Values 4 Math L4 family (`round()`, `mod()`, `rem()`, `sin`, `cos`, `tan`, `asin`, `acos`, `atan`, `atan2`, `pow`, `sqrt`, `hypot`, `log`, `exp`, `abs`, `sign`). Constants `pi` and `e` resolve in any context.
23
23
-**Modern color spaces**: `oklch(...)`, `oklab(...)`, `lch(...)`, `lab(...)`, `color-mix(in <space>, ...)`. Wide-gamut inputs that fall outside sRGB are gamut-mapped to the closest in-gamut color while preserving hue. Percent channels follow CSS Color L4 ranges (`lab(50% 0 0)` is mid-gray).
24
24
-**Relative-color syntax** (CSS Color 5) for the four modern spaces: `oklch(from #ff0000 calc(l - 0.15) c h)`. Theme-token bases work too: `oklch(from ${theme.colors.brand} calc(l - 0.15) c h)`.
25
25
-**`color-mix(in <space>, …)`** through `srgb`, `oklab`, `oklch`, `lab`, or `lch`.
@@ -38,7 +38,7 @@ const Card = styled.View`
38
38
-**`field-sizing: content`** auto-grows a `<TextInput>` to its content.
39
39
-**`interactivity: inert`** suppresses interaction and hides the subtree from screen readers.
40
40
41
-
**`env(safe-area-inset-*)` caveat.** The function parses correctly but currently resolves to 0 — the integration with `react-native-safe-area-context` is not wired yet. Use `useSafeAreaInsets()` directly until that lands.
41
+
**`env(safe-area-inset-*)` caveat.** The function parses correctly but currently resolves to 0; the integration with `react-native-safe-area-context` is not wired yet. Use `useSafeAreaInsets()` directly until that lands.
The same CSS works on web and native. Anchor pseudo-states with `&` (bare `:hover` parses as a descendant selector, not a state).
64
64
65
-
**Pseudo-states.**`&:hover`, `&:focus`, `&:focus-visible`, `&:pressed`, `&:disabled`. Hover on native uses Pressable's pointer events on RN ≥ 0.85, but stock RN gates them behind a feature flag that defaults to FALSE in 0.85 — flip it at app startup to get `&:hover` to fire:
65
+
**Pseudo-states.**`&:hover`, `&:focus`, `&:focus-visible`, `&:pressed`, `&:disabled`. Hover on native uses Pressable's pointer events on RN ≥ 0.85, but stock RN gates them behind a feature flag that defaults to FALSE in 0.85. Flip it at app startup to get `&:hover` to fire:
**`:is()` and `:where()`.** Apply the rule to each listed state: `&:is(:hover, :focus)`.
100
100
101
-
**Tree-structural pseudos.**`:first-child`, `:last-child`, `:only-child`, `:first-of-type`, `:last-of-type`, `:only-of-type`, and the functional `:nth-*(<an+b>)` family with `odd` / `even` keywords. Siblings need to be inside a styled-component parent for indexing to work — a non-styled wrapper in between resets the count.
101
+
**Tree-structural pseudos.**`:first-child`, `:last-child`, `:only-child`, `:first-of-type`, `:last-of-type`, `:only-of-type`, and the functional `:nth-*(<an+b>)` family with `odd` / `even` keywords. Siblings need to be inside a styled-component parent for indexing to work; a non-styled wrapper in between resets the count.
102
102
103
103
**Combinators between styled-component references.**
104
104
@@ -112,7 +112,7 @@ const Title = styled.Text`
112
112
`;
113
113
```
114
114
115
-
Descendant matching (`${Foo} &`) is transparent to non-styled wrappers. The child combinator (`>`) requires the matched element to be a direct child of a published parent — a non-styled wrapper in between will break the match.
115
+
Descendant matching (`${Foo} &`) is transparent to non-styled wrappers. The child combinator (`>`) requires the matched element to be a direct child of a published parent; a non-styled wrapper in between will break the match.
116
116
117
117
### Animations
118
118
@@ -129,7 +129,7 @@ const Card = styled.View`
129
129
130
130
Eligible properties (opacity, every color, all border radius corners, transforms, shadows, filter) run on the native thread. `@keyframes` and `@starting-style` (first-mount enter animations) work the same way. `animation-direction`, `animation-fill-mode`, `animation-play-state`, `animation-iteration-count`, `animation-composition` (`replace | add | accumulate`), and per-frame easing all work without extra imports.
131
131
132
-
CSS easing matches the W3C spec curves: `ease`, `ease-in`, `ease-out`, `ease-in-out`, `cubic-bezier()`, `steps()`, `linear()`. Note: the CSS `ease` keyword is the W3C `ease` curve, not React Native's `Easing.ease` (which is `ease-in`). `prefers-reduced-motion` is honored — durations collapse to 0 when the OS setting is on.
132
+
CSS easing matches the W3C spec curves: `ease`, `ease-in`, `ease-out`, `ease-in-out`, `cubic-bezier()`, `steps()`, `linear()`. Note: the CSS `ease` keyword is the W3C `ease` curve, not React Native's `Easing.ease` (which is `ease-in`). `prefers-reduced-motion` is honored; durations collapse to 0 when the OS setting is on.
133
133
134
134
If you'd rather drive animations through reanimated, the optional adapter is one import:
Many React Native libraries take styling through component props rather than the `style` prop —`react-native-svg`'s `<Path fill="..." stroke="..." />`, charting libraries with `tintColor`, icon libraries with `color`. The function form of `.attrs((props, ast) => ...)` accepts a second `ast` argument that lets you read CSS declarations or theme tokens and rewrite them onto the rendered component as props:
144
+
Many React Native libraries take styling through component props rather than the `style` prop:`react-native-svg`'s `<Path fill="..." stroke="..." />`, charting libraries with `tintColor`, icon libraries with `color`. The function form of `.attrs((props, ast) => ...)` accepts a second `ast` argument that lets you read CSS declarations or theme tokens and rewrite them onto the rendered component as props:
`ast.pop(key)` reads the value and prevents the declaration from reaching the rendered style. `ast.peek(key)` reads without removing — use it when both the prop and the CSS declaration should flow through. Both accept an optional fallback.
169
+
`ast.pop(key)` reads the value and prevents the declaration from reaching the rendered style. `ast.peek(key)` reads without removing; use it when both the prop and the CSS declaration should flow through. Both accept an optional fallback.
170
170
171
171
The first argument dispatches on shape: a CSS property name (`'color'`, `'borderColor'`) reads a resolved declaration; a dot-separated path (`'palette.brand.primary'`) reads from the active theme with autocomplete and type inference from your augmented `DefaultTheme`.
172
172
@@ -204,11 +204,11 @@ These spec features pass through to react-native-web but do not render on React
-`@supports` is parsed but its condition is never evaluated against the runtime — declarations inside always apply on native. Branch with `Platform.OS` instead.
207
+
-`@supports` is parsed but its condition is never evaluated against the runtime, so declarations inside always apply on native. Branch with `Platform.OS` instead.
Platform-conditional features (the matrix has the full story):
211
211
212
-
-`filter` — only `brightness` and `opacity` apply on iOS without the SwiftUI opt-in (set `ReactNativeReleaseLevel: experimental` in `Info.plist` / `ios.infoPlist`); Android `blur` and `drop-shadow` require API 31+.
213
-
-`mix-blend-mode` — all 16 non-Normal modes on iOS; Android needs API 29+.
214
-
-`transform: skewX/skewY` — iOS renders correctly; Android silently drops the shear pending an upstream fix.
212
+
-`filter`: only `brightness` and `opacity` apply on iOS without the SwiftUI opt-in (set `ReactNativeReleaseLevel: experimental` in `Info.plist` / `ios.infoPlist`); Android `blur` and `drop-shadow` require API 31+.
213
+
-`mix-blend-mode`: all 16 non-Normal modes on iOS; Android needs API 29+.
214
+
-`transform: skewX/skewY`: iOS renders correctly; Android silently drops the shear pending an upstream fix.
Copy file name to clipboardExpand all lines: sections/v7/whats-new.mdx
+1-11Lines changed: 1 addition & 11 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -21,24 +21,14 @@ The bottleneck now is funding. styled-components can help provide a universal Re
21
21
- **In-house CSS parser** replaces stylis as the runtime engine. No more `:is()` / `:where()` / `:has()` recursion bugs, no more silent breakage on modern at-rules.
22
22
- **Modern CSS on React Native.** `@media` and `@container` queries, viewport and container-query units, font-relative units, modern color spaces, relative-color syntax, the full Math L4 family, logical shorthands, gradients, and filters all work in `styled.View\`...\``. See [React Native gets modern CSS](#react-native-gets-modern-css) for the full surface and the [compatibility matrix](/docs/compatibility) for per-feature status.
23
23
- **Selectors and combinators on React Native.** Attribute selectors with every operator, `:not(<simple>)`, `:has(<simple>)`, tree-structural pseudos, the four combinators between styled-component references, and the `:hover` / `:focus` / `:pressed` / `:disabled` pseudo-states.
24
-
- **Native animations** by default. `transition`, `@keyframes`, and `@starting-style` run on React Native through the built-in `Animated`-based adapter — no setup, no peer dependency. An optional reanimated adapter is available behind one import (experimental; not heavily tested yet).
24
+
- **Native animations** by default. `transition`, `@keyframes`, and `@starting-style` run on React Native through the built-in `Animated`-based adapter, with no setup or peer dependency. An optional reanimated adapter is available behind one import (experimental; not heavily tested yet).
25
25
- **`createTheme()` on native**, with the same contract as web. `<ThemeProvider>` deep-merges nested themes so an inner override that touches one leaf keeps the siblings it inherited.
26
26
- **Plugins subpath.** `import { rtlPlugin, rscPlugin } from 'styled-components/plugins'`. First-party RTL replaces `stylis-plugin-rtl`; custom plugins move to a narrower `SCPlugin` interface. See [Plugins moved to a dedicated subpath](#plugins-moved-to-a-dedicated-subpath).
27
27
- **`extractCSS()`** reads the current stylesheet as plain text. Replaces the legacy `disableCSSOMInjection` toggle.
28
28
- **Global styles emit once.** Mounting the same `createGlobalStyle` component multiple times now emits its CSS only once.
29
29
- **Remapping CSS into native props** via the function form of `.attrs((props, ast) => ...)`. Most useful for React Native libraries that style via props (e.g. `react-native-svg`'s `<Path fill="..." />`, `Image`'s `tintColor`, icon libraries). [Details →](/docs/basics#bridging-styles-into-props)
30
30
- **Faster SSR at scale.**
31
31
32
-
### Removed in v7
33
-
34
-
The [migration guide](#migrating-from-v6) has the full porting steps. At a glance:
35
-
36
-
- `defaultProps` on function components — React 19 dropped it. Use `.attrs()` or `<ThemeProvider>`.
37
-
- `disableCSSOMInjection` prop and the `SC_DISABLE_SPEEDY` env var — reach for `extractCSS()` instead.
38
-
- `enableVendorPrefixes` and the runtime vendor prefixer — declare both forms in CSS or run a build-time PostCSS transform for the few properties that still need them.
39
-
- `css-to-react-native` as a peer dependency — folded into core.
40
-
- Top-level `stylisPluginRSC` export — now `rscPlugin` from `styled-components/plugins`.
0 commit comments