Skip to content

feat: pseudo-selectors web implementation#9474

Open
wisniewskij wants to merge 30 commits into
mainfrom
@wisniewskij/pseudo-selectors-web
Open

feat: pseudo-selectors web implementation#9474
wisniewskij wants to merge 30 commits into
mainfrom
@wisniewskij/pseudo-selectors-web

Conversation

@wisniewskij

@wisniewskij wisniewskij commented May 20, 2026

Copy link
Copy Markdown
Contributor

Web part of pseudoselectors.

Test plan

Run normal pseudoselectors tests and web specific tests and see if they pass.

@wisniewskij wisniewskij force-pushed the @wisniewskij/pseudo-selectors-ts-frontend branch from 04ed294 to 49bcf41 Compare May 28, 2026 15:57
Base automatically changed from @wisniewskij/pseudo-selectors-ts-frontend to main May 28, 2026 17:28
@wisniewskij wisniewskij force-pushed the @wisniewskij/pseudo-selectors-web branch from c4b65b0 to 31bb6c1 Compare June 2, 2026 08:06
@wisniewskij wisniewskij changed the base branch from main to @wisniewskij/pseudo-selectors-examples June 2, 2026 08:07
@wisniewskij wisniewskij force-pushed the @wisniewskij/pseudo-selectors-web branch 2 times, most recently from 753d056 to c4042ee Compare June 2, 2026 16:22
@wisniewskij wisniewskij requested a review from MatiPl01 June 2, 2026 17:33
@wisniewskij wisniewskij force-pushed the @wisniewskij/pseudo-selectors-web branch 2 times, most recently from 00030a0 to 8d35f45 Compare June 8, 2026 12:30
@wisniewskij wisniewskij changed the base branch from @wisniewskij/pseudo-selectors-examples to main June 8, 2026 12:31
@wisniewskij wisniewskij changed the base branch from main to @wisniewskij/pseudo-selectors-examples June 8, 2026 12:32
@wisniewskij wisniewskij force-pushed the @wisniewskij/pseudo-selectors-examples branch from 085d46d to 8138e7d Compare June 8, 2026 12:39
wisniewskij and others added 2 commits June 8, 2026 14:41
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
@wisniewskij wisniewskij force-pushed the @wisniewskij/pseudo-selectors-web branch from 8d35f45 to 87fa469 Compare June 8, 2026 12:41
Base automatically changed from @wisniewskij/pseudo-selectors-examples to main June 8, 2026 13:33
@wisniewskij wisniewskij self-assigned this Jun 8, 2026

@MatiPl01 MatiPl01 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Left a few comments. Please also don't implement pseudo-selector-related methods between insertCSSAnimation and removeCSSAnimation, rather at them at the end of the file or somewhere else, so that the order of functions in domUtils makes more sense and is not random.

Comment thread packages/react-native-reanimated/src/css/web/domUtils.ts Outdated
Comment thread packages/react-native-reanimated/src/css/web/domUtils.ts Outdated
Comment thread packages/react-native-reanimated/src/css/web/managers/CSSManager.ts Outdated
Comment thread packages/react-native-reanimated/src/css/web/managers/CSSManager.ts Outdated

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Implements web support for CSS pseudo-selector styles in Reanimated by generating and managing per-view CSS rules in a shared stylesheet, aligning web behavior with existing pseudo-selector support in the broader CSS system.

Changes:

  • Added CSSPseudoSelectorsManager (web) that builds ordered pseudo-selector CSS rules (including :active-deepest) and injects/removes them via domUtils.
  • Updated web CSSManager to create and update the pseudo-selector manager alongside animations and transitions.
  • Extended domUtils with a shared rule registry to support insertion/removal of both keyframes and pseudo-selector rules; added unit tests for the new manager and pseudo-selector guards; updated the common-app web example.

Reviewed changes

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

Show a summary per file
File Description
packages/react-native-reanimated/src/css/web/managers/CSSPseudoSelectorsManager.ts New web manager that generates/injects pseudo-selector CSS rules per view.
packages/react-native-reanimated/src/css/web/managers/CSSManager.ts Wires pseudo-selector manager into the web CSS pipeline.
packages/react-native-reanimated/src/css/web/managers/tests/CSSPseudoSelectorsManager.test.ts Unit tests for selector rule generation and lifecycle behavior (mocking domUtils).
packages/react-native-reanimated/src/css/web/domUtils.ts Generalized stylesheet rule insertion/removal and added pseudo-selector rule APIs.
packages/react-native-reanimated/src/css/utils/tests/guards.test.ts Adds test coverage for pseudo-selector value guard logic.
apps/common-app/src/apps/css/examples/transitions/screens/pseudoSelectors/ArbitraryWebSelectors.tsx Updates the web example to demonstrate :focus-visible with a pressable element.

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

Comment thread packages/react-native-reanimated/src/css/web/managers/CSSManager.ts Outdated
Comment thread packages/react-native-reanimated/src/css/web/domUtils.ts

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 7 out of 7 changed files in this pull request and generated 2 comments.

pull Bot pushed a commit to esinanturan/react-native-reanimated that referenced this pull request Jun 11, 2026

@MatiPl01 MatiPl01 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Left some minor comments. Overall, good job!

Comment thread packages/react-native-reanimated/src/css/web/domUtils.ts Outdated
Comment thread packages/react-native-reanimated/src/css/web/__tests__/domUtils.web.test.ts Outdated
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants