![Get the computed style of an element](https://javascriptsource.com/wp-content/uploads/2021/11/Get-the-computed-style-of-an-element-702x526.jpg)
Get the actual computed style of an element. This factors in browser default stylesheets as well as external styles you’ve specified.
var elem = document.querySelector('#some-elem');
var bgColor = window.getComputedStyle(elem).backgroundColor;
Source
https://vanillajstoolkit.com/reference/style/window-getcomputedstyle/