Skip to content

Rotating gradient border in WordPress

A card framed by a violet, pink, amber and cyan conic gradient ring that spins endlessly, with a coloured halo, 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-bordure-degrade-rotatif.php
<?php
/**
 * Plugin Name: Forge, Bordure en dégradé rotatif
 * Description: Une carte entourée d’un anneau en dégradé conique violet, rose, ambre et cyan qui tourne sans fin, avec un halo coloré, en CSS pur. Ajoute la composition « Bordure en dégradé rotatif » à 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-bordure-degrade-rotatif
 *
pattern.html
<!-- wp:group {"tagName": "article", "className": "efbr", "layout": {"type": "default"}} -->
<article class="wp-block-group efbr"><!-- wp:html -->
<span class="efbr__halo" aria-hidden="true"><span class="efbr__spin"></span></span>
<!-- /wp:html -->
<!-- wp:html -->
<span class="efbr__ring" aria-hidden="true"><span class="efbr__spin"></span></span>
<!-- /wp:html -->
<!-- wp:group {"className": "efbr__inner", "layout": {"type": "default"}} -->
<div class="wp-block-group efbr__inner"><!-- wp:paragraph {"className": "efbr__eyebrow"} -->
<p class="efbr__eyebrow">Atelier d’écriture · Session d’hiver</p>
<!-- /wp:paragraph -->
<!-- wp:heading {"level": 2, "className": "efbr__title"} -->
style.css
:root {
  --efbr-card: #ffffff;
  --efbr-text: #17151f;
  --efbr-body: #4a4658;
  --efbr-accent: #6d28d9;
  --efbr-c1: #7c3aed;
  --efbr-c2: #ec4899;
  --efbr-c3: #f59e0b;
  --efbr-c4: #06b6d4;
  --efbr-halo: 0.55;
  --efbr-width: 3px;
  --efbr-radius: 1.5rem;

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