Skip to content

Scrolling polka-dot background in WordPress

A polka-dot pattern slides endlessly on a diagonal behind a panel, in pure CSS, with no image or script.

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-fond-pois-defilant.php
<?php
/**
 * Plugin Name: Forge, Fond à pois défilant
 * Description: Un motif de pois glisse sans fin en diagonale derrière un encart, en CSS pur, sans image ni script. Ajoute la composition « Fond à pois défilant » à 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-fond-pois-defilant
 *
pattern.html
<!-- wp:group {"tagName": "section", "className": "efpd", "layout": {"type": "default"}} -->
<section class="wp-block-group efpd"><!-- wp:html -->
<span class="efpd-dots" aria-hidden="true"></span>
<!-- /wp:html -->
<!-- wp:group {"className": "efpd-panel", "layout": {"type": "default"}} -->
<div class="wp-block-group efpd-panel"><!-- wp:paragraph {"className": "efpd-eyebrow"} -->
<p class="efpd-eyebrow">Atelier Pigment · Lyon 4e</p>
<!-- /wp:paragraph -->
<!-- wp:heading {"level": 2, "className": "efpd-title", "anchor": "efpd-titre"} -->
<h2 class="wp-block-heading efpd-title" id="efpd-titre">Ateliers d’arts plastiques pour les 6-11 ans</h2>
<!-- /wp:heading -->
<!-- wp:paragraph {"className": "efpd-text"} -->
style.css
:root {
  --efpd-bg: #fde68a;
  --efpd-dot: rgb(180 83 9 / 0.45);
  --efpd-panel: #fffdf7;
  --efpd-text: #2b2118;
  --efpd-muted: #5b4a3a;
  --efpd-accent: #b45309;
  --efpd-accent-text: #ffffff;
  --demo-effet-fond-pois-defilant-bg: #f6f1e7;
  --demo-effet-fond-pois-defilant-text: #2b2118;
}

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