Основываясь на этом предыдущем ответе , вот идея, где вам нужно будет продублировать текст:
h1 {
font-family:sans-serif;
font-size:60px;
font-weight: bold;
position:relative;
margin:20px;
}
h1::before,
h1::after {
content:attr(data-text);
}
h1::after {
color:#fff; /*use white*/
/*create the stroke around text*/
text-shadow:
1px 0 0px #000,
0 1px 0px #000,
1px 1px 0px #000,
-1px 0 0px #000,
0 -1px 0px #000,
-1px -1px 0px #000,
-1px 1px 0px #000,
1px -1px 0px #000;
mix-blend-mode: darken; /*everything is more dark than white so we always see the background */
}
h1::before {
position:absolute;
top:0;
left:0;
background:linear-gradient(to bottom,yellow 50%, red 51%);
-webkit-background-clip: text;
background-clip: text;
-webkit-text-fill-color: transparent;
color:transparent;
}
<h1 data-text="Heading 1"></h1>