Skip to content

Glitch heading in WordPress

A heading that jolts now and then, with cyan and magenta ghosts cut into slices, in pure CSS.

Here is an excerpt of this component's code in WordPress. The full code is free for members, ready to copy into your project.

This component also comes in

Open in a new tab

The code in WordPress

effet-texte-glitch.php
<?php
/**
 * Plugin Name: Forge, Titre à effet glitch
 * Description: Un titre qui se décale par intermittence, avec des fantômes cyan et magenta découpés en tranches, en CSS pur. Ajoute la composition « Titre à effet glitch » à l'éditeur de blocs.
 * Version: 1.0.0
 * Requires at least: 6.6
 * Requires PHP: 8.1
 * Author: Forge
 * License: GPL-2.0-or-later
 * License URI: https://www.gnu.org/licenses/gpl-2.0.html
 * Text Domain: forge-effet-texte-glitch
 *
pattern.html
<!-- wp:group {"className": "efgl", "layout": {"type": "default"}} -->
<div class="wp-block-group efgl"><!-- wp:paragraph {"className": "efgl__eyebrow"} -->
<p class="efgl__eyebrow">Festival des arts numériques · Lyon, du 5 au 7 mars</p>
<!-- /wp:paragraph -->
<!-- wp:heading {"level": 2, "className": "efgl__title"} -->
<h2 class="wp-block-heading efgl__title">Quand les écrans <span class="efgl__glitch" data-text="déraillent">déraillent</span></h2>
<!-- /wp:heading -->
<!-- wp:paragraph {"className": "efgl__text"} -->
<p class="efgl__text">Trois jours d’installations interactives, de concerts audiovisuels et d’ateliers de création sonore, ouverts à tous dès 12 ans.</p>
<!-- /wp:paragraph --></div>
<!-- /wp:group -->
style.css
:root {
  --efgl-text: #14121a;
  --efgl-body: #474356;
  --efgl-ghost-a: #0891b2;
  --efgl-ghost-b: #db2777;
  --demo-effet-texte-glitch-bg: #ffffff;
  --demo-effet-texte-glitch-text: #14121a;
}

@media (prefers-color-scheme: dark) {
  :root.forge-follows-system:not([data-theme="light"]) {
    --efgl-text: #f6f5fa;

Free component: copy it freely, including for commercial projects.

Visual effects components in WordPress
  • Cards that fade in as they enter the screen, one after another in each row, without a line of JavaScript and with a static fallback.

    • Tailwind
    • React
    • CSS
    • WordPress
    Component
  • A translucent card with a saturated blur whose sharper edge refracts the colourful shapes drifting behind it, with an opaque fallback when transparency is reduced.

    • Tailwind
    • React
    • CSS
    • WordPress
    Component
  • A help block shaped like a conversation: bubbles, three animated typing dots and clickable quick replies that show your answers to frequent questions, frozen under prefers-reduced-motion.

    • Tailwind
    • React
    • CSS
    • WordPress
    Component
  • A paragraph whose words turn from grey to full ink, one by one, as the page scrolls, in pure CSS with a plain-text fallback.

    • Tailwind
    • React
    • CSS
    • WordPress
    Component
  • Four offset, translucent sine waves gently roll along the bottom of a section, each at its own pace.

    • Tailwind
    • React
    • CSS
    • WordPress
    Component