react-modal icon indicating copy to clipboard operation
react-modal copied to clipboard

Add overlay/content example

Open arist0tl3 opened this issue 3 years ago • 7 comments

Added an example I used to animate modal content in and apply an opacity transition to the overlay. If this is interesting I can look into adding to the /examples as well.

Acceptance Checklist:

  • [x] The commit message follows the guidelines in CONTRIBUTING.md.
  • [n/a] Documentation (README.md) and examples have been updated as needed.
  • [n/a] If this is a code change, a spec testing the functionality has been added.
  • [n/a] If the commit message has [changed] or [removed], there is an upgrade path above.

arist0tl3 avatar Sep 21 '22 01:09 arist0tl3

LEGIT. Obrigado, @arist0tl3!

diasbruno avatar Sep 21 '22 01:09 diasbruno

The style is the "default style" that we use on the examples, right?

diasbruno avatar Sep 21 '22 01:09 diasbruno

@diasbruno

I think I understand what you were getting at -- just updated the example to use the default styles and note that transform will need to be removed in order for this example to work properly.

arist0tl3 avatar Sep 21 '22 01:09 arist0tl3

Great. Is there a bug on the styles of the examples?

diasbruno avatar Sep 21 '22 01:09 diasbruno

No, but if I try to do this:

.ReactModal__Content {
  transform: translate(-50%, 150%);
  transition: transform 800ms ease-in-out;
}

.ReactModal__Content--after-open {
  transform: translate(-50%, -50%);
}

.ReactModal__Content--before-close {
  transform: translate(-50%, 150%);
}

the inline style will take precedence. It felt better to suggest removing that inline style and define it instead as a css rule vs keeping it as is and adding !important to the rules above.

arist0tl3 avatar Sep 21 '22 01:09 arist0tl3

Took a stab at wording it; lmk if it does/doesn't make sense lol

arist0tl3 avatar Sep 21 '22 01:09 arist0tl3

Everything looks good. Thanks so much for taking the time to help with the docs. Grande Lavoro. :tada: Grazie mille.

diasbruno avatar Sep 21 '22 01:09 diasbruno