Skip to content

Instantly share code, notes, and snippets.

@rubinchyk
Last active November 21, 2016 12:11
Show Gist options
  • Save rubinchyk/8398ca7bfec84ca05f62 to your computer and use it in GitHub Desktop.
Save rubinchyk/8398ca7bfec84ca05f62 to your computer and use it in GitHub Desktop.
CSS-Animation: Border bottom filling from left to right green line.
<div>
<input class="dollar-value" type="text" />
<span class="animation-border"></span>
</div>
// Need 'Bourbon' for includes
$green: #00d246;
$grey: #989c9f;
.dollar {
position: absolute;
color: $green;
font-size: 18px;
font-weight: 400;
left: 58px
}
.dollar-value {
border: none;
font-size: 18px;
border-bottom: 2px solid $grey;
width: 221px;
border-radius: 1px;
padding-left: 30px;
margin-left: 50px;
&:focus {
outline: 0;
}
&:focus + .animation-border {
@include animation-name(green-line-focus);
@include animation-duration(.5s);
@include animation-timing-function(ease-in-out);
@include animation-fill-mode(forwards);
}
}
@include keyframes(green-line-focus) {
from {
padding-left: 0;
width: 0;
}
to {
padding-left: 30px;
width: 221px;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment