I'm trying to access a CSS rule's value using getComputedStyle. The following is the value I'm trying to access:
background: linear-gradient(to right, red , yellow);
But when I test this I instead receive the following value:
rgba(0, 0, 0, 0) linear-gradient(to right, red, yellow) repeat scroll 0% 0% / auto padding-box border-box
Following is the code I'm using:
console.log(window.getComputedStyle(body, null).getPropertyValue("background"));
I wanted explanation as to why these additional values are being printed, why I'm not getting only the value written in my stylesheet, and how I would go about only getting that value.