Skip to content

Line-by-line heading reveal in WordPress

The lines of a large heading rise one after the other from behind a mask, like film credits, 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-revelation-lignes-titre.php
<?php
/**
 * Plugin Name: Forge, Titre révélé ligne par ligne
 * Description: Les lignes d’un grand titre montent l’une après l’autre de derrière un masque, comme au générique d’un film, en CSS pur. Ajoute la composition « Titre révélé ligne par ligne » à 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-revelation-lignes-titre
 *
pattern.html
<!-- wp:group {"tagName": "section", "className": "efrl", "layout": {"type": "default"}} -->
<section class="wp-block-group efrl"><!-- wp:paragraph {"className": "efrl-eyebrow"} -->
<p class="efrl-eyebrow">Roche &amp; Vidal, architectes · Grenoble</p>
<!-- /wp:paragraph -->
<!-- wp:heading {"level": 2, "className": "efrl-title", "anchor": "efrl-titre"} -->
<h2 class="wp-block-heading efrl-title" id="efrl-titre"><span class="efrl-mask"><span class="efrl-line" style="--efrl-i: 0">Nous dessinons</span></span><span class="efrl-mask"><span class="efrl-line" style="--efrl-i: 1">des maisons qui</span></span><span class="efrl-mask"><span class="efrl-line" style="--efrl-i: 2">vieillissent bien.</span></span></h2>
<!-- /wp:heading -->
<!-- wp:group {"className": "efrl-after", "layout": {"type": "default"}} -->
<div class="wp-block-group efrl-after"><!-- wp:paragraph {"className": "efrl-text"} -->
<p class="efrl-text">Maisons bioclimatiques, extensions en bois et rénovations de fermes en Isère et en Savoie, de l’esquisse au suivi de chantier.</p>
<!-- /wp:paragraph -->
<!-- wp:html -->
style.css
:root {
  --efrl-bg: #f4f1ec;
  --efrl-text: #1d1b18;
  --efrl-muted: #55504a;
  --efrl-accent: #1d1b18;
  --efrl-accent-text: #f4f1ec;
  --demo-effet-revelation-lignes-titre-bg: #e9e4dc;
  --demo-effet-revelation-lignes-titre-text: #1d1b18;
}

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

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