Skip to content

Instantly share code, notes, and snippets.

@dan-laskowski
Created October 2, 2020 16:45
Show Gist options
  • Save dan-laskowski/84bd26a67df2ebcf8c911b7d7a02e8ed to your computer and use it in GitHub Desktop.
Save dan-laskowski/84bd26a67df2ebcf8c911b7d7a02e8ed to your computer and use it in GitHub Desktop.
[Animated line-through text] #css #animation
.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