[PF-1994] Migrate Modal fix shades#5015
Conversation
|
| Name | Type |
|---|---|
| @toptal/picasso-modal | Patch |
| @toptal/picasso-rich-text-editor | Patch |
| @toptal/picasso | Patch |
| @toptal/picasso-prompt-modal | Patch |
| @toptal/picasso-forms | Patch |
| @toptal/picasso-query-builder | Patch |
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
|
📖 Storybook Preview 🚀 Your Storybook preview is ready: View Storybook 📍 Preview URL: This preview is updated automatically when you push changes to this PR. |
|
📖 Storybook Preview 🚀 Your Storybook preview is ready: View Storybook 📍 Preview URL: This preview is updated automatically when you push changes to this PR. |
Instead of showing them conditionally we animate them with opacity
b2a45f9 to
4bede77
Compare
|
📖 Storybook Preview 🚀 Your Storybook preview is ready: View Storybook 📍 Preview URL: This preview is updated automatically when you push changes to this PR. |
|
📖 Storybook Preview 🚀 Your Storybook preview is ready: View Storybook 📍 Preview URL: This preview is updated automatically when you push changes to this PR. |
|
🗑️ Storybook preview cleaned up The preview deployment has been automatically removed since this PR was closed. |
PF-1994
Description
ModalContentrenders top/bottom gradient "shades" that hint at scrollableoverflow. Previously each shade was conditionally mounted (
{top && …}/{bottom && …}), so it popped in and out of the DOM as the user scrolled,with no transition.
This changes both shades to be always rendered and toggled purely in CSS:
visibility is driven from the DOM via a
data-activeattribute, and the fadeis handled by
opacity+transition-opacity duration-300.Motivations:
instead of appearing/disappearing instantly.
data-[…]:variants (read state from the DOM) rather than branching therender tree (
AGENTS.md › Styling).duration-300matches the sibling overlay surface(
Drawerusestransition-opacity duration-300), and both shades now shareone class string, fixing a prior mismatch where only the bottom shade carried
duration-300.Scope:
Propsandclasses?: { root, topShade, bottomShade }are untouched, so consumers need no migration.
use-scrollable-shades) is intentionally unchanged; this PRonly changes how the shades are displayed. (A CSS-only detection path —
animation-timeline: scroll()/scroll-state()— isn't viable under therepo's browserslist, which still targets Safari 13+ and Firefox.)
How to test
Content story).
it should fade out. Scroll to the very bottom: the bottom shade should
fade out.
Screenshots
Before-1.mp4
After-1.mp4