AI CSS Animations

Neon Flicker Text

Glowing text that flickers like a neon tube with a loose connection. Layered text-shadows make the glow and a few sharp dips in opacity make the flicker. Best on dark backgrounds.

Also known as: neon sign text, flickering neon, glow text css.

OPEN LATE

HTML

<div class="txt-neon-flicker">OPEN LATE</div>

CSS

.txt-neon-flicker {
  --c: var(--txt-color, #3b82f6);
  font-size: var(--txt-size, 32px);
  font-family: system-ui, sans-serif;
  font-weight: 700;
  line-height: 1.2;
  color: #fff;
  letter-spacing: 0.1em;
  text-shadow: 0 0 0.1em #fff, 0 0 0.3em var(--c), 0 0 0.8em var(--c), 0 0 1.6em var(--c);
  animation: txt-neon-flicker-buzz 3s infinite;}
@keyframes txt-neon-flicker-buzz {
  0%, 18%, 22%, 25%, 53%, 57%, 100% {
    opacity: 1;
    text-shadow: 0 0 0.1em #fff, 0 0 0.3em var(--c), 0 0 0.8em var(--c), 0 0 1.6em var(--c);
  }
  20%, 24%, 55% {
    opacity: 0.6;
    text-shadow: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .txt-neon-flicker, .txt-neon-flicker *, .txt-neon-flicker::before, .txt-neon-flicker::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

Customizing this snippet

  • Color: set --txt-color on the element or a parent. Currently previewing #3b82f6.
  • Font size: set --txt-size. Every other dimension is in em, so the whole thing scales together. Currently previewing 40px.
  • Speed: change the duration on the transition or animation shorthand. Staggered delays are relative, so they keep their rhythm.
  • Reduced motion: the rule at the end of the CSS turns the motion off for people who asked their OS for less of it. Keep it.

Similar text animations