Use getComputedStyle() to read the actual styles applied to an element, including styles from CSS files.
const el = document.querySelector("div");
const styles = getComputedStyle(el);
console.log(styles.backgroundColor);
console.log(styles.fontSize);
This returns the final computed values after all CSS rules apply.