A stack of big words where pointing at one blurs and dims the rest. The :has() selector reacts only when a word is hovered, so the gaps between words never dim the list.
Also known as: blur siblings on hover, dim other items on hover, focus hover effect css.
<div class="hfx-text-sibling-blur"> <span>Design</span> <span>Build</span> <span>Launch</span> </div>
.hfx-text-sibling-blur {
--c: var(--hfx-color, #3b82f6);
font-size: calc(var(--hfx-size, 16px) * 2);
font-family: system-ui, sans-serif;
font-weight: 800;
line-height: 1.15;
cursor: default;
display: flex;
flex-direction: column;
align-items: flex-start;
line-height: 1.1;}
.hfx-text-sibling-blur span {
transition: filter 0.35s ease, opacity 0.35s ease, color 0.35s ease,
transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.hfx-text-sibling-blur:has(span:hover) span:not(:hover) {
filter: blur(0.05em);
opacity: 0.35;
}
.hfx-text-sibling-blur span:hover {
color: var(--c);
transform: translateX(0.2em);
}
@media (prefers-reduced-motion: reduce) {
.hfx-text-sibling-blur, .hfx-text-sibling-blur *, .hfx-text-sibling-blur::before, .hfx-text-sibling-blur::after, .hfx-text-sibling-blur *::before, .hfx-text-sibling-blur *::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.