pico icon indicating copy to clipboard operation
pico copied to clipboard

Better documentationn for modal animation

Open LokiMidgard opened this issue 3 years ago • 2 comments

When I used the modal dialog, I saw following entry in the docs

.modal-is-opening brings an opening animation.

I assumed applying this to html would enable opening animation. It took some try and error to find out if I need to set this attribute before or after I set open, and how long I need to wait.

The docs should include the nescessary js code.

LokiMidgard avatar Jan 07 '22 15:01 LokiMidgard

Hi @LokiMidgard,

Yes, I understand. I don't want to document the JavaScript (or not too much) because I consider that it is not part of Pico.

But for sure we can bring more details to the documentation. What would be your suggestions?

lucaslarroche avatar Jan 09 '22 04:01 lucaslarroche

I understand the JS part. And thats what I like about pico.

Mybe something like this:

To animate opening
1. Set .modal-is-opening on html
2. then trigger opening of dialog
3. wait 400ms (or the variable that holds the value if it is configurable)
4. remove the class again

To close
1. set modal-is-closing
2. wait 400ms
3. close the dialog
4. remove the class

I'm not 100% sure if thats how it is inteded, but it seams to work...

If I were shure, I would have propably already created an pullrequest ^^

LokiMidgard avatar Jan 10 '22 08:01 LokiMidgard

can i work on this?

geckguy avatar Apr 09 '23 06:04 geckguy