Tuesday, 15 April 2014

JavaScript dynamically detect all CSS values -



JavaScript dynamically detect all CSS values -

this script dynamically detects possible style properties element supports...

for (i in document.getelementbyid('body').style) { document.getelementbyid('q').value = document.getelementbyid('q').value+', '+i; }

my question how dynamically observe possible values given property supports? dynamic clearly mean not creating array possible values (static) , iterating on array using css.supports.

im not sure that's possible since endless. looking see classes of values acceptable.

when property value number top accepts length can in, cm, mm, pt, pc, px, ex, em, percentage, auto, or inherit

in case of content accepts different range of values normal, none, string's, uri's, counter, attr(attrname), open-quote, close-quote, no-open-quote, no-close-quote, inherit (and it's possible it's looking combination of things)

(src:w3.org)

each property described in w3 document has different set of types accepts.

i don't know how javascript spit out kind of schema/dtd come exhaustive list of potential values represent classes of values , test each using css.supports(propertyname,value);

javascript css

No comments:

Post a Comment