Рет қаралды 153,454
A common problem people ask me about is animating from, or to display: none, since it's not an animatable property.
After making my recent video on the dialog element, I got a lot of questions about animating it in and out, and it just so happens to use `display: none` when it's closed, so I saw it as a good opportunity to take a look at it.
🔗 Links
✅ The video on the dialog element: kzbin.info/www/bejne/inKlkKlsrqeLf6c
✅ The CodePen: codepen.io/kevinpowell/pen/QWaBeGm
✅ Open Props: open-props.style/
✅ Video introducing Open Props: kzbin.info/www/bejne/qauzf4CBj8atsLM
⌚ Timestamps
00:00 - Introduction
01:32 - What we're starting with
01:59 - Adding the animation on open
02:52 - The problem with backdrop
03:53 - Getting the backdrop to fade in
04:31 - Why it's easy to animate on open but not on close
05:28 - A quick fix for animating the close
06:37 - the problems with this solution
08:37 - Making a "closing" state
09:15 - Making the closing state work
14:06 - The problem with different animations on close
15:01 - Closing when we click outside the modal
19:36 - fixing the backdrop shadow effect
#css
--
Come hang out with other dev's in my Discord Community
💬 discord.gg/nTYCvrK
Keep up to date with everything I'm up to
✉ www.kevinpowell.co/newsletter
Come hang out with me live every Monday on Twitch!
📺 www.twitch.tv/kevinpowellcss
---
Help support my channel
👨🎓 Get a course: www.kevinpowell.co/courses
👕 Buy a shirt: teespring.com/stores/making-the-internet-awesome
💖 Support me on Patreon: www.patreon.com/kevinpowell
---
My editor: VS Code - code.visualstudio.com/
---
I'm on some other places on the internet too!
If you'd like a behind the scenes and previews of what's coming up on my KZbin channel, make sure to follow me on Instagram and Twitter.
Twitter: KevinJPowell
Codepen: codepen.io/kevinpowell/
Github: github.com/kevin-powell
---
And whatever you do, don't forget to keep on making your corner of the internet just a little bit more awesome!