Skip to content

docs(v7): native CanIUse + v7 docs pulled up to latest styled-components#1005

Merged
quantizor merged 6 commits into
mainfrom
docs/v7-native-feature-sweep
May 19, 2026
Merged

docs(v7): native CanIUse + v7 docs pulled up to latest styled-components#1005
quantizor merged 6 commits into
mainfrom
docs/v7-native-feature-sweep

Conversation

@quantizor

Copy link
Copy Markdown
Contributor

Summary

Pulls the latest v7 native polyfill surface from ~/code/styled-components into the website's CanIUse matrix and the v7 docs surface. Every claim about stock React Native was sanity-checked against ~/code/react-native v0.85.2.

New v7 features documented

  • accent-color tints <Switch> (auto resolves to the platform accent color)
  • overscroll-behavior: contain | none and scrollbar-width: none on ScrollView / FlatList
  • text-overflow: ellipsis | clip on <Text>
  • direction: ltr | rtl controls <Text> bidi (mirrors to writing direction)
  • letter-spacing accepts em / rem / lh / rlh
  • font-size keyword parity across iOS / Android / web (xx-small...xxx-large, smaller, larger)
  • CSS Color 4 system color keywords resolve inside box-shadow, filter: drop-shadow(), background, and linear-gradient color stops
  • animation-composition longhand (comma-separated coordinating list)
  • :nth-child(<an+b> of S) / :nth-last-child(<an+b> of S) with simple inner selectors (component ref or single attribute selector)
  • styled.ScrollView defaults to flex-shrink: 0 so explicit dimensions pin reliably
  • border-radius slash form works on native when circular; elliptical drops with dev-warn
  • border-style: hidden resolves to no border; mixed-side styles warn instead of misrendering

Fixes from cross-checking against react-native 0.85.2

  • aspect-ratio slash form (16 / 9) works natively without v7; matrix used to say it dropped
  • mix-blend-mode iOS count corrected to 15 non-normal modes (CSS Compositing 1)

AGENTS.md updates

  • Compatibility matrix entries describe author-facing behavior, not internals
  • Public-facing docs strip mechanism; matrix has a narrow allowance for naming public RN props
  • American English in all prose
  • No em-dashes; full punctuation family otherwise

Test plan

  • npx jest -c .jest.config.js passes locally (pre-commit hook ran clean)
  • /docs/compatibility renders new entries (accent-color, overscroll-behavior, scrollbar-width, text-overflow, border-radius slash caveat, etc.)
  • /docs/v7 reads cleanly without internal mechanism leaking through
  • public/llms.txt is parseable and behavior-focused

New v7 surface reflected across the compatibility matrix and v7 docs:
accent-color, overscroll-behavior, scrollbar-width, text-overflow,
direction → writingDirection, font-size keyword parity, letter-spacing
font-relative units, CSS Color 4 system-color fold inside box-shadow /
filter / background / linear-gradient stops, animation-composition
longhand, :nth-child(<an+b> of S), styled.ScrollView flex-shrink: 0
default, border-radius slash form, border-style hidden / mixed handling.

Fixes verified against react-native 0.85.2: aspect-ratio slash form
actually works natively without v7; mix-blend-mode iOS count is 15
non-normal modes, not 16.

AGENTS.md gains rules: matrix entries describe author-facing behavior
not internals (public RN prop names allowed); public docs strip
mechanism; American English in all prose.
Copilot AI review requested due to automatic review settings May 18, 2026 06:00
@changeset-bot

changeset-bot Bot commented May 18, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: aa2c32e

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@vercel

vercel Bot commented May 18, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
styled-components Ready Ready Preview, Comment May 19, 2026 3:58am

Request Review

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Updates the v7 React Native documentation and compatibility matrix to reflect newer styled-components/native CSS polyfill support and stock React Native behavior.

Changes:

  • Expands utils/cssCompat.ts with updated v7 support claims, caveats, and React Native compatibility details.
  • Updates /docs/v7 native docs and public/llms.txt with the new v7 native feature surface.
  • Adds AGENTS.md prose/documentation guidance for future docs edits.

Reviewed changes

Copilot reviewed 3 out of 4 changed files in this pull request and generated 6 comments.

File Description
utils/cssCompat.ts Updates compatibility matrix entries for v7 native CSS support and caveats.
sections/v7/native.mdx Adds new v7 React Native feature highlights.
public/llms.txt Mirrors v7 native feature guidance for LLM-readable docs.
AGENTS.md Adds public-doc prose and compatibility-matrix authoring guidance.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread sections/v7/native.mdx Outdated
- **`place-items`** and **`place-self`** for the align axis.
- **`field-sizing: content`** auto-grows a `<TextInput>` to its content.
- **`interactivity: inert`** suppresses interaction and hides the subtree from screen readers.
- **`text-overflow: ellipsis | clip`** truncates `<Text>`; pair with `line-clamp: N` for multi-line.
Comment thread public/llms.txt Outdated
`place-items` and `place-self` shorthands work for the align axis (Yoga doesn't have `justify-items` / `justify-self`; the justify side is a no-op on native but reaches rn-web).

`field-sizing: content` on `<TextInput>` auto-grows the field to its content. `interactivity: inert` (CSS UI 5) suppresses interaction and hides the subtree from accessibility services.
`field-sizing: content` on `<TextInput>` auto-grows the field to its content. `interactivity: inert` (CSS UI 5) suppresses interaction and hides the subtree from accessibility services. `text-overflow: ellipsis | clip` truncates `<Text>` (pair with `line-clamp: N` for multi-line). `overscroll-behavior: contain | none` disables overscroll on `ScrollView` / `FlatList`; `scrollbar-width: none` hides scroll indicators. `accent-color` tints `<Switch>` (`auto` picks up the platform accent color). `direction: ltr | rtl` controls `<Text>` bidi. `styled.ScrollView` defaults to `flex-shrink: 0` so explicit `width:` / `height:` pin reliably inside a flex parent (opt back in with `flex-shrink: 1`).
Comment thread utils/cssCompat.ts Outdated
iosStock: 'no',
androidStock: 'no',
summary:
"Pass-through on web. Stock React Native has no `textOverflow` style key; v7 also has no handler for it. Use `numberOfLines={N}` with `ellipsizeMode='tail' | 'head' | 'middle' | 'clip'` on the Text component, or `line-clamp: N` which v7 DOES polyfill (see the line-clamp entry).",
"Pass-through on web. Stock React Native has no `textOverflow` style key. v7 polyfills `text-overflow: ellipsis | clip` by lifting `ellipsizeMode` ('tail' or 'clip') as a top-level prop on `<Text>`. Pair with `line-clamp: N` (also polyfilled to `numberOfLines: N`) for multi-line ellipsizing. v7 does not implement the spec's two-value form (`text-overflow: <start> <end>`) or string-value overflow markers; those drop on native.",
Comment thread utils/cssCompat.ts Outdated
iosStock: 'no',
androidStock: 'no',
summary:
'Pass-through on web. React Native\'s `ScrollView` configures overscroll per-platform via props instead: `bounces={false}` disables iOS rubber-banding and `overScrollMode="never"` disables the Android edge glow. No CSS style key wires up to either.',
"Pass-through on web. Stock React Native's `ScrollView` configures overscroll per-platform via props (`bounces={false}` to disable iOS rubber-banding, `overScrollMode=\"never\"` to disable the Android edge glow); no CSS style key wires up to either. v7 polyfills `overscroll-behavior: contain | none` by lifting `bounces: false` and `overScrollMode: 'never'` onto `ScrollView` / `FlatList`; `auto` and `chain` restore the platform defaults.",
Comment thread utils/cssCompat.ts Outdated
@@ -744,7 +742,8 @@ export const COMPAT_ENTRIES: CompatEntry[] = [
nativeV7: 'yes',
iosStock: 'yes',
androidStock: 'yes',
summary: 'Pass-through everywhere.',
summary:
'Pass-through everywhere. v7 also accepts the slash-separated form (`10px / 10px`) on native when it resolves to a circular radius; truly elliptical combinations (different horizontal and vertical radii) drop with a dev-warn since RN has no per-axis radius surface.',
Comment thread AGENTS.md Outdated
Comment on lines +52 to +53
- Public-facing docs (`sections/`, `public/llms.txt`, blog posts, compatibility matrix entries) describe user-observable behavior only: what is supported, what isn't, what to author. Skip mechanism (how the polyfill maps, what prop it lifts, internal field names, parser / handler / registry mechanics, ABI prefixes, dev-warn IDs, sentinel names).
- The compatibility matrix has slightly more leeway because it explains version skew. When a matrix entry must mention a stock-RN API to explain why a CSS feature works, name the public prop (`numberOfLines`, `trackColor`) rather than the internal call site. Caveats are still gotchas the author needs to act on, not internals.
- object-fit: rn-web Image now picks up the CSS property via resizeMode
- styled.ScrollView flex-shrink: 0 baseline applies on native only;
  rn-web keeps the default so scrolling works
Trim polyfill mechanism (lifts X, polyfills by Y, attaches Z) out of
matrix summaries and v7 docs. Keep what's supported, what isn't, what
to author. Affected entries: accent-color, overscroll-behavior,
scrollbar-width, text-overflow, direction, object-fit, line-clamp,
background-blend-mode, interactivity, caret-color, ScrollView baseline.
quantizor added 2 commits May 18, 2026 23:15
… bundle

CSS custom properties cascade through styled components on native: declare
`--name: value` and descendants read it back via `var(--name, fallback)`.
References resolve inside every conditional bucket (`@media`, `@container`,
attribute, pseudo-state, `:has()`, `:nth-child()`, combinator).

`!important` is honored within a component for base + every conditional
bucket, flows through `var()` substitution and render-time resolvers, and
beats a runtime `style={{ ... }}` prop. Ignored inside `@keyframes` per
spec. Cross-component cascade is not yet supported.

`font-size` accepts the full unit catalogue: viewport units, container
query units, font-relative, font-metric approximations, and absolute
lengths.

`styled-components/native` now ships a dedicated build for `react-native-web`
consumers, auto-detected by Webpack / Vite / Metro web targets.
Replaced em-dashes across docs prose with colons, semicolons, periods,
or parentheses per the project rule. Dropped the literal em-dash glyph
from the blog byline divider in favor of a middle dot.

Fixed three Nav components that pixel sizes through `rem()`; nav and
sidebar widths use plain px from `utils/sizes.ts`.

`utils/blog.server.ts` now loads MDX modules concurrently via
`Promise.all`. `utils/cssCompatFormats.ts` deduplicates a double sort.
`Nav/SidebarMenus.tsx` hoists `activeHref(pathname)` out of its top-level
`.map` so the lookup runs once per render instead of per item.

Removed two unused exports: `searchModalWidth` in `utils/sizes.ts`
and the precomputed `Author.websiteHost` in `utils/authors.ts`.
- text-overflow: make the required companion line limit explicit
  (sections/v7/native.mdx, public/llms.txt, utils/cssCompat.ts).
  RN's ellipsizeMode is a no-op without numberOfLines, so authors
  need line-clamp or text-wrap: nowrap alongside text-overflow.
- overscroll-behavior: drop `chain` from the summary. It is not a
  valid CSS keyword; the spec only accepts auto | contain | none.
- border-radius: downgrade v6, iosStock, androidStock to `partial`
  to reflect that only v7 accepts the slash-separated CSS grammar
  (when circular). Stock RN has no per-axis radius surface.
- AGENTS.md: remove the contradiction between the public-docs rule
  and the matrix exception. Matrix follows the same no-mechanism
  rule, with one narrow exception for naming a public stock-RN
  prop when explaining version skew.
@quantizor quantizor merged commit 00596a8 into main May 19, 2026
3 checks passed
@quantizor quantizor deleted the docs/v7-native-feature-sweep branch May 19, 2026 03:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants