Repository navigation
[react-modal] feature: use @starting-style for entry animation - #155
marlonmarcello with Copilot wants to merge 20 commits into
Conversation
🦋 Changeset detectedLatest commit: acc94e5 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
Co-authored-by: marlonmarcello <1956448+marlonmarcello@users.noreply.github.com>
@starting-style for entry animation
Co-authored-by: marlonmarcello <1956448+marlonmarcello@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> Signed-off-by: Marlon U. Marcello <marlon.marcello@gmail.com>
Signed-off-by: Marlon U. Marcello <marlon.marcello@gmail.com>
Co-authored-by: marlonmarcello <1956448+marlonmarcello@users.noreply.github.com>
|
@copilot rebase this from |
Co-authored-by: marlonmarcello <1956448+marlonmarcello@users.noreply.github.com>
Co-authored-by: marlonmarcello <1956448+marlonmarcello@users.noreply.github.com>
…owmodal' into copilot/update-entry-animation-starting-style # Conflicts: # README.md # src/main.tsx
|
@copilot rebase from |
There was a problem hiding this comment.
🟡 Changes recommended
The demo content becomes transparent immediately on close, hiding its intended scale-down exit animation.
1 open issue
What changed in this PR
Updates modal animations to use native CSS @starting-style and keeps dialogs mounted to support CSS exit transitions.
Changes:
- Adds optional
isOpencontrol and makesrenderTooptional onModal. - Updates demos and documentation to use mounted dialogs with CSS transitions.
- Allows
@starting-stylein Stylelint.
| File | Description |
|---|---|
src/main.tsx |
Keeps demo dialogs mounted and passes their open state. |
src/main.module.css |
Adds entry styles and dialog exit transitions. |
src/lib/components/modal/modal.tsx |
Supports controlled opening and closing through isOpen. |
README.md |
Documents mounted-dialog usage and CSS animation examples. |
.stylelintrc |
Allows the @starting-style at-rule. |
Review effort: Balanced
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> Signed-off-by: Marlon U. Marcello <marlon.marcello@gmail.com>
|
@copilot make sure to run the script for the changeset and tag this as minor |
Ran the Changesets script and added a minor changeset in |
|
@copilot rebase from |
…animation-starting-style Co-authored-by: marlonmarcello <1956448+marlonmarcello@users.noreply.github.com>
Merged |
NicholasLancey
left a comment
There was a problem hiding this comment.
PR looks good to me @marlonmarcello. This is an awesome use of vanilla CSS transitions rather than a hook. And agreed with keeping the modal mounted, dialog is hidden when closed so no need to remove it!
|
@copilot do one final rebase from |
…animation-starting-style Co-authored-by: marlonmarcello <1956448+marlonmarcello@users.noreply.github.com>
Merged the latest |
|
@copilot fix the linting issue |
Fixed the lint issue in |

Description
Replaces the two-class CSS toggle pattern for entry animation with the native
@starting-styleat-rule, enabling pure-CSS entry transitions without JavaScript class management or external animation libraries.Solution
Before — required two classes and toggling between them:
After — single class; browser handles the initial state automatically:
src/main.module.css— removed.CustomModalTransitionOpen; resting state defined in.CustomModalTransition; initial state moved into@starting-styleblock.src/main.tsx— applies.CustomModalTransitionon the demoModalContentto exercise the animation.README.md— full example updated to show@starting-styleCSS approach; drops the@wethegit/react-hooks/useAnimatePresencedependency from the example entirely..stylelintrc— adds@starting-styletoat-rule-no-unknownignore list.Additional Notes
Browser support:
@starting-styleis supported in Chrome 117+, Firefox 129+, and Safari 17.5+. Not supported in older browsers — animations will simply not play (graceful degradation; the modal still functions correctly).Screenshots
N/A
Original prompt
@starting-stylefor entry animation #129📍 Connect Copilot coding agent with Jira, Azure Boards or Linear to delegate work to Copilot in one click without leaving your project management tool.