An outlined button that switches on like a neon sign: the text and border glow, and light bleeds inward. Meant for dark backgrounds.
Also known as: neon glow button, cyberpunk button.
<button class="hfx-neon">Enter</button>
.hfx-neon {
--c: var(--hfx-color, #3b82f6);
font-size: var(--hfx-size, 16px);
display: inline-flex;
align-items: center;
gap: 0.5em;
padding: 0.7em 1.6em;
border-radius: 0.5em;
font: 600 1em system-ui, sans-serif;
cursor: pointer;
border: 2px solid var(--c);
background: transparent;
color: var(--c);
letter-spacing: 0.08em;
text-transform: uppercase;
transition: box-shadow 0.3s ease, text-shadow 0.3s ease, background-color 0.3s ease;}
.hfx-neon:hover {
background: color-mix(in srgb, var(--c) 10%, transparent);
text-shadow: 0 0 0.5em var(--c);
box-shadow: 0 0 0.5em var(--c), 0 0 1.5em color-mix(in srgb, var(--c) 60%, transparent), inset 0 0 0.8em color-mix(in srgb, var(--c) 30%, transparent);
}
@media (prefers-reduced-motion: reduce) {
.hfx-neon, .hfx-neon *, .hfx-neon::before, .hfx-neon::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.