Skip to content

Layered heading on hover

A large three-colour layered heading whose layers spread apart when the card is hovered or entered with the keyboard, in pure CSS.

  • Tailwind
  • React
  • CSS
  • WordPress
Open in a new tab

Description

Behind the heading, two slightly offset coloured copies give it a screen-printed poster relief; when the card is hovered, or when keyboard focus reaches its button, the layers spread apart with a small bounce, then close up again. The real heading remains a single h2 read once: both copies are hidden from screen readers, and the foreground text keeps AA contrast in light and dark mode. Layers are stacked in the same grid cell and only their transform is animated, with no script or animated shadow; offsets are in em so they follow the heading size. Layer colours set with variables (--efts-mid, --efts-back). With prefers-reduced-motion the relief changes without motion. No overflow at 360 px thanks to a fluid size. Example: a craft brewery in Roubaix.

Code

Loading the code…

The code of this component in

Archive contents

effet-texte-relief-survol-html-tailwind.zip3 files · 4 Ko

  • index.html3 Ko
  • README.md3 Ko
  • LICENSE.md1 Ko

Tags

Updated on December 2, 2026.

Reviews

No reviews yet.

In the same spirit

  • 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