Skip to content

Instantly share code, notes, and snippets.

@LeaVerou
Created July 5, 2019 18:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save LeaVerou/9fb853efc0ab40812ece9c46a9ee262c to your computer and use it in GitHub Desktop.
Save LeaVerou/9fb853efc0ab40812ece9c46a9ee262c to your computer and use it in GitHub Desktop.
Different transition on reverse
/**
* Different transition on reverse
*/
p {
width: 200px; height: 200px;
background: yellow;
transition: 1s;
}
p:hover {
background: yellowgreen;
transition-duration: 0s;
}
p + p { transition-duration: 0s }
p + p:hover { transition-duration: 1s }
<p>On hover, no transition, on mouse out, 1s
<p>On hover, 1s, on mouse out, no transition
// alert('Hello world!');
{"view":"split-vertical","fontsize":"100","seethrough":"","prefixfree":"","page":"css"}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment