Created
October 2, 2020 16:45
-
-
Save dan-laskowski/84bd26a67df2ebcf8c911b7d7a02e8ed to your computer and use it in GitHub Desktop.
[Animated line-through text] #css #animation
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
.todo-item__text--completed { | |
display: inline-block; | |
position: relative; | |
transition: all .5 cubic-bezier(.55,0,.1,1); | |
/* text-decoration: line-through; */ | |
} | |
.todo-item__text--completed:after { | |
content: ''; | |
position: absolute; | |
display: block; | |
width: 100%; | |
height: 2px; | |
box-shadow: 0 1px rgba(255,255,255,0.6); | |
margin-top: -0.5em; | |
background: black; | |
transform-origin: center left; | |
animation: strikethrough 1s cubic-bezier(.55, 0, .1, 1) 1; | |
} | |
@keyframes strikethrough { | |
from { | |
transform: scaleX(0); | |
} | |
to { | |
transform: scaleX(1); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment