How could I replicate the above effect? So far I tried the following, but the text is just white:
h1 {
background-image: var(--rainbow-gradient,#fff);
background-size: 100%;
background-repeat: repeat;
-webkit-background-clip: text;
-webkit-text-fill-color: transparent;
-moz-background-clip: text;
-moz-text-fill-color: transparent;
filter: drop-shadow(0 0 2rem #000);
text-shadow: none!important;
}
<H1>Hello world</H1>

Here is a simple working version:
Most browsers support it, but it is non-standard so don't rely on it for crucial things.