When using the window.getComputedStyle method to get a CSS value, it may not return the actual value. Depending on the browser implementation, the browser can return an empty String or a deliberately wrong value (for security in that case).
As an example, getting the padding shorthand CSS property in Firefox will fail because it complies to the CSS specifications (surprisingly Chrome doesn't).
When using the
window.getComputedStyle
method to get a CSS value, it may not return the actual value. Depending on the browser implementation, the browser can return an emptyString
or a deliberately wrong value (for security in that case).As an example, getting the
padding
shorthand CSS property in Firefox will fail because it complies to the CSS specifications (surprisingly Chrome doesn't).It might be worth complying to the various browser implementations. See https://developer.mozilla.org/en-US/docs/Web/CSS/used_value#Difference_from_computed_values