Skip to content

Layered heading on hover in WordPress

A large three-colour layered heading whose layers spread apart when the card is hovered or entered with the keyboard, 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-relief-survol.php
<?php
/**
 * Plugin Name: Forge, Titre en relief au survol
 * Description: Un grand titre en relief à trois couleurs dont les couches s’écartent quand on survole la carte ou qu’on y entre au clavier, en CSS pur. Ajoute la composition « Titre en relief au survol » à 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-relief-survol
 *
pattern.html
<!-- wp:group {"tagName": "section", "className": "efts-card", "layout": {"type": "default"}} -->
<section class="wp-block-group efts-card"><!-- wp:paragraph {"className": "efts-eyebrow"} -->
<p class="efts-eyebrow">Brasserie artisanale · Roubaix</p>
<!-- /wp:paragraph -->
<!-- wp:heading {"level": 2, "className": "efts-title", "anchor": "efts-titre"} -->
<h2 class="wp-block-heading efts-title" id="efts-titre"><span class="efts-layer efts-layer--2" aria-hidden="true">Houblon &amp; Cie</span>
          <span class="efts-layer efts-layer--1" aria-hidden="true">Houblon &amp; Cie</span>
          <span class="efts-front">Houblon &amp; Cie</span></h2>
<!-- /wp:heading -->
<!-- wp:paragraph {"className": "efts-text"} -->
<p class="efts-text">Bières brassées dans une ancienne filature, du houblon des Flandres et une salle de dégustation ouverte du jeudi au samedi.</p>
<!-- /wp:paragraph -->
style.css
:root {
  --efts-bg: #fef3c7;
  --efts-text: #1c1917;
  --efts-muted: #44403c;
  --efts-front: #1c1917;
  --efts-mid: #ea580c;
  --efts-back: #0d9488;
  --efts-accent: #1c1917;
  --efts-accent-text: #fef3c7;
  --demo-effet-texte-relief-survol-bg: #f5efe0;
  --demo-effet-texte-relief-survol-text: #1c1917;
}

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