Skip to content

Instantly share code, notes, and snippets.

@marcospassos
Last active July 8, 2020 02:52
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save marcospassos/2c7d51a7df6d31170b589f093344107d to your computer and use it in GitHub Desktop.
Save marcospassos/2c7d51a7df6d31170b589f093344107d to your computer and use it in GitHub Desktop.
Tailwind Toast annimation
<!--
Smoothie sliding up toast animation
Entering: "ease-out duration-300 transition transform"
From: "opacity-0 translate-y-2 sm:translate-y-0 sm:translate-x-2"
To: "opacity-100 translate-y-0 sm:translate-x-0"
Leaving: "ease-in-out duration-300 transition-all transform"
onExit: node => node.style.maxHeight = node.getBoundingClientRect().height
From: "opacity-100 opacity-100 mb-5 translate-y-0 sm:translate-x-0"
onExiting={node => node.style.maxHeight = ''}
To: "opacity-0 max-h-0 mb-0 translate-y-2 sm:translate-y-0 sm:translate-x-2"
-->
<!-- Container element -->
<div class="fixed inset-0 flex flex-col items-start justify-end px-4 py-6 pointer-events-none sm:p-6 sm:items-end sm:justify-start">
</div>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment