Get CSS property

Let’s say I deploy an application. I can use the Google Chrome inbuilt developer tools and inspect the elements on the page. Upon doing say, I can see the HTML and CSS that builds each element. I can see that a certain button is 178px is width, for example.

How could I get that value in the code? How could I get CSS values in the code, basically? Sometimes the width of components is undefined, and component.getWidth() returns -1. How could we get the exact width (as rendered) in pixels? Please keep in mind that the component I am interested in by the way is a MenuBar which does not extend AbstractComponent, causing the SizeReporter addon to be useless (as per my knowledge).