Can anyone help me figure out why I'm not able to access a CSS rule's value correctly using getComputedStyle? Here's what I'm dealing with:
background: linear-gradient(to right, red , yellow);
However, the result I'm getting is different than expected:
rgba(0, 0, 0, 0) linear-gradient(to right, red, yellow) repeat scroll 0% 0% / auto padding-box border-box
This is the code I'm currently using:
console.log(window.getComputedStyle(body, null).getPropertyValue("background"));
I'm seeking an explanation as to why these extra values are being displayed instead of just the background value from my stylesheet, and how can I modify my code to only retrieve that specific value.