• Home
  • About Mitch
  • Speaking
  • Articles
  • Contact
  • Home
  • About Mitch
  • Speaking
  • Articles
  • Contact

Digital Strategist

WordPress Developer

Content Creator

Unapologetic Punk

Mitch Canter

  • X
  • Bluesky
  • GitHub
  • Twitch
  • YouTube
  • LinkedIn
Design, Tutorial, WordPress

How to Add Rainbow Text To WordPress

CMDR Mitchcraft

Reading time: 1 minute
blue and yellow abstract painting

I’ve been tinkering with the theme on this website, and I’m been very happy with how things have come out. I have a soft spot for gradients, especially with the ‘punk’ color scheme I’ve been using on my branding.

One question I get, consistently: “How can I achieve the rainbow gradient text effect”?

It’s actually really easy to do.

I have a helper class I’ve added to the CSS file in this child theme (a child theme of Ollie, by the way), with code similar to this:

.--is-rainbow{
    background: linear-gradient(135deg, var(--wp--preset--color--primary), var(--wp--preset--color--secondary));
    background-clip: text !important;
    -webkit-background-clip: text; /* For WebKit browsers */
    color: transparent;
    -webkit-text-fill-color: transparent; /* For older WebKit browsers */
}

This code does three things:

  • Sets the gradient color as a linear gradient spanning the background of the element
  • Uses background-clip and webkit-background-clip to tell the element to use the text as the borders for clipping
  • Uses color and -webkit-text-fill-color to set the font color to a transparent value to allow the background to show through

Once this code is in, it’s as easy as adding the class in the “Advanced” section of the editor sidebar.

And… voila! Rainbow text, usable on any text element in your WordPress block-based website.

Note: if you aren’t running a block-based theme, simply add the class --is-rainbow to your element in the HTML code and the rainbow will appear just the same!

css, Tutorial, WordPress
  • Go Update W3 Total Cache, WPTouch, and AddThis RIGHT NOW!

    Go Update W3 Total Cache, WPTouch, and AddThis RIGHT NOW!

    Reading time: 1 minute

    If you’ve updated your plugins in the last 24 hours, go straight back into your website and do it again – there’s a chance you may have downloaded some infected plugins that were hacked into the repository. According to WordPress.org, the plugins AddThis, W3 Total Cache, and WPTouch were infected with a backdoor that lets…

    WordPress
  • WordPress Tip: iTunes Integration via last.fm

    WordPress Tip: iTunes Integration via last.fm

    Reading time: 1 minute

    So, you’ve got a personal blog and want to integrate your iTunes playlist into WordPress, but don’t just want to say that you’re listening to a CD – you want to display the album art too? WordPress has a few solutions that work great.  The easiest way to do that is by utilizing the “scrobbler”…

    Tutorial, WordPress