GeneratePress Animated RGB Header Shadow: Tested CSS

Add a red-green-blue glow under your GeneratePress navigation with a few lines of CSS.

Affiliate links: we may earn a commission at no extra cost to you. It never changes our verdicts.

Short answer

paste the CSS below into Appearance, Customize, Additional CSS. Your navigation gets a glow that cycles red, green and blue every 4 seconds. It switches off on phones and for visitors who prefer reduced motion.

Pritam Sonone
Verified byPritam Sonone
Read time4 min read

Summarize with AI:

Share

What is it?An animated RGB shadow is a CSS effect that cycles a glowing red, green and blue box-shadow around an element, here the GeneratePress navigation bar.

See it working

Screenshots from our test: GeneratePress on a clean WordPress install, at 0, 1.3 and 2.6 seconds.

GeneratePress navigation with the animated RGB shadow in red, green and blue
Tested 17 Oct 2026: red, green, then blue

The CSS

Copy it as is; it includes the phone and reduced-motion rules we added after testing.

/* Copyright © Digital Pritam (digitalpritam.in) */
@keyframes rgbShadowAnimation {
    0%   { box-shadow: 0 5px 15px 5px rgba(255, 0, 0, 0.25); }  /* Red */
    33%  { box-shadow: 0 5px 15px 5px rgba(0, 255, 0, 0.25); }  /* Green */
    66%  { box-shadow: 0 5px 15px 5px rgba(0, 0, 255, 0.25); }  /* Blue */
    100% { box-shadow: 0 5px 15px 5px rgba(255, 0, 0, 0.25); }  /* Red again */
}

.main-navigation:not(.slideout-navigation),
.sticky-enabled .main-navigation.is_stuck {
    animation: rgbShadowAnimation 4s infinite;
}

/* No animation on phones */
@media (max-width: 768px) {
    .main-navigation:not(.slideout-navigation),
    .sticky-enabled .main-navigation.is_stuck {
        animation: none;
        box-shadow: none;
    }
}

/* Respect visitors who turn off motion */
@media (prefers-reduced-motion: reduce) {
    .main-navigation:not(.slideout-navigation),
    .sticky-enabled .main-navigation.is_stuck {
        animation: none;
    }
}

How to add it

  1. Open the Customizer

    WordPress dashboard, Appearance, Customize.

  2. Paste into Additional CSS

    Or add it to your child theme’s style.css.

  3. Optional: move the menu below the header

    Layout, Primary Navigation, Navigation Location: Below Header, for a full-width glow.

  4. Publish and check

    Check desktop, phone and a sticky menu if you use one.

More on the theme: our GeneratePress review and theme speed test.

Add the RGB shadow, step by step with screenshots

We pasted the CSS above into GeneratePress 3.6.1 on our lab site, 24 Oct 2026.

Tap any screenshot to open it full size. A still screenshot shows one frame of the animation.

  1. 1

    Activate it

    When the install finishes, the same card shows Activate. Click it.

    Activate GeneratePress
    Activate GeneratePress
  2. 2

    Paste the CSS

    Appearance, Customize, Additional CSS. Paste the code, check the preview, then click Publish.

    The RGB shadow CSS in GeneratePress Additional CSS
    The RGB shadow CSS in GeneratePress Additional CSS
  3. 3

    See the glow

    The navigation bar now has a soft shadow that cycles red, green and blue every 4 seconds. Phones and reduced-motion visitors get no animation.

    The RGB shadow on the GeneratePress menu, our lab site
    The RGB shadow on the GeneratePress menu, our lab site
Free checklist

Pick a free checklist. Get the best deals too.

Plus an email when each big hosting, WordPress and AI tool sale opens, with the price checked by us.

Choose your free checklist

Sent to your inbox instantly. Unsubscribe in one click. Privacy policy

RGB header shadow: FAQ

Still have a question?Ask Pritam directly. Every message is read.Ask a question
Where do I add the CSS in GeneratePress?

Appearance, Customize, Additional CSS, or your child theme’s style.css. No plugin is needed.

Does it work with the free GeneratePress theme?

Yes. We tested it on the free GeneratePress theme on a clean WordPress install; the .main-navigation class is part of the free theme.

Why does the glow only wrap my menu?

On the default layout the menu floats to the right of the logo. Set Customize, Layout, Primary Navigation, Navigation Location to Below Header for a full-width glowing bar.

Will it slow my site down?

It is a few lines of CSS with no JavaScript. Animating box-shadow repaints the bar, so we switch it off on phones and for visitors who prefer reduced motion.

How do I change the speed or colours?

Change 4s to a longer or shorter time, and edit the three rgba() colours; the last number (0.25) controls how strong the glow is.

Methodology

How this page was built, so you can check it.

Detail
Date17 Oct 2026
EnvironmentWordPress Playground (latest WordPress, PHP 8.3), a clean install with GeneratePress 3.6.1 and nothing else
VersionsGeneratePress 3.6.1
ProcedureAdded the CSS under Appearance, Customize, Additional CSS, then captured screenshots of the menu at 0, 1.3 and 2.6 seconds and at phone width
MeasuredVisual result of the animation, and behaviour with reduced motion enabled
LimitsTested in one browser engine; very old browsers may not animate the shadow
Who checked this

About this page

Pritam Sonone

Pritam Sonone

Founder of Digital Pritam. WordPress developer and designer, WordCamp Kolhapur 2025 speaker. Builds WordPress sites for clients.

How we checked

  • CSS tested on GeneratePress 3.6.1 on a clean WordPress install (PHP 8.3) on 17 Oct 2026
  • Screenshots taken at 0, 1.3 and 2.6 seconds of the animation
  • Phone and reduced-motion rules checked in the same test

Sources: GeneratePress · MDN: prefers-reduced-motion

Read our full testing process

Affiliate links: we may earn a commission at no extra cost to you. It never changes our verdicts.

Share