Skip to content

Instantly share code, notes, and snippets.

@xiel
Created November 14, 2012 23:24
Show Gist options
  • Save xiel/4075566 to your computer and use it in GitHub Desktop.
Save xiel/4075566 to your computer and use it in GitHub Desktop.
Pseudo-Element Transition Webkit Bug Fix
/*
Pseudo-Element Transition Webkit Bug Fix
*/
a {
transition: 500ms; /* only the parent element needs the transition */
}
a {
position: relative;
border: 0 none;
border-color: #f26 transparent; /* the transitioned value, inherited by the pseudo element */
border-radius: 5px;
padding: 10px 20px;
font: 16px/1 sans-serif;
line-height: 1em;
color: #fff;
background: #f26;
}
a:hover {
background: #dd0;
border-color: #dd0 transparent; /* changed hover value */
}
a:after {
display: block;
position: absolute;
left: 50%;
margin-left: -10px;
bottom: -10px;
content: '';
border-style: solid;
border-width: 10px 10px 0 10px;
border-color: inherit; /* inherit the transition */
}
body {
padding: 30px;
}
<a>Button with pseudo</a>
{"view":"split","fontsize":"110","seethrough":"","prefixfree":"1","page":"all"}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment