Created
November 23, 2016 10:14
-
-
Save Yelakelly/3a239a2ba810681ad6e76620a4f169f0 to your computer and use it in GitHub Desktop.
Placeholder animate - Sass mixin
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<input type="text" placeholder="It's here" /> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
body{ | |
padding:15px; | |
} | |
@mixin placeholder-animate($property, $interval, $time: 0.3s, $time-function: ease-out){ | |
&::placeholder{ | |
#{$property}: nth($interval, 1); | |
transition: #{$property} $time linear; | |
} | |
&:focus{ | |
&::placeholder{ | |
#{$property}: nth($interval, 2); | |
} | |
} | |
} | |
input{ | |
display: inline-block; | |
padding:15px 10px; | |
$interval: #333 #eee; | |
@include placeholder-animate(color, $interval); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment