A line draws through the middle of the text on hover while the text fades. Good for 'compare plans' style toggles and nav items that mean 'not this one'.
Also known as: line through hover, crossed out link.
<a class="hfx-link-strike" href="#">Old pricing</a>
.hfx-link-strike {
--c: var(--hfx-color, #3b82f6);
font-size: var(--hfx-size, 16px);
position: relative;
display: inline-block;
color: var(--c);
font: 600 1em system-ui, sans-serif;
text-decoration: none;
color: inherit;
transition: color 0.3s ease;}
.hfx-link-strike::after {
content: "";
position: absolute;
left: 0;
top: 55%;
width: 100%;
height: 2px;
background: var(--c);
transform: scaleX(0);
transform-origin: left;
transition: transform 0.3s ease;
}
.hfx-link-strike:hover { color: #9ca3af; }
.hfx-link-strike:hover::after { transform: scaleX(1); }
@media (prefers-reduced-motion: reduce) {
.hfx-link-strike, .hfx-link-strike *, .hfx-link-strike::before, .hfx-link-strike::after {
animation-duration: 0.01ms !important;
animation-iteration-count: 1 !important;
transition-duration: 0.01ms !important;
}
}--hfx-color on the element or a parent.
Currently previewing #3b82f6.--hfx-size. Every other dimension is in
em, so the whole thing scales together. Currently previewing 16px.transition or animation
shorthand. Staggered delays are relative, so they keep their rhythm.