I am facing a dilemma where I need to determine the value of the 'width' property for a css class named 'foo' (example: ".foo { width:200px}" ).
However, there may not be an element with this class in the dom yet.
My goal is to retrieve this value using Javascript in order to calculate percentages for setting a detailed layout involving other divs.
While it seems unlikely, I believe having this capability would greatly enhance defining design and layout properties in CSS.
Is there any known method to achieve this without resorting to unconventional hacks like offscreen rendering of divs for querying class properties?
Possibly, a standard browser JavaScript library could be developed to address this matter - such as a document.styles object. In that case, my desired property could potentially be accessed from within JavaScript like so: "document.styles.foo.width" - How can I go about proposing this idea to the w3c?