W3C home > Mailing lists > Public > www-style@w3.org > September 2011

styling <meter>

From: Andrew Fedoniouk <andrew.fedoniouk@live.com>
Date: Mon, 12 Sep 2011 21:01:11 -0700
Message-ID: <BLU165-ds6AF40277290B23B37AEFBF8050@phx.gbl>
To: "HTML WG" <public-html@w3.org>
Cc: <www-style@w3.org>
Simple question: is <meter> element [1] styleable by CSS in 
principle? 

The <meter> can be in low/high/optimum states and
for CSS purposes it is desirable to reflect somehow these
states as :flags or [attributes] so CSS selectors can be used
to define at least something. 

Otherwise authors will not be motivated to use <meter> where
it is really needed. 

And yet, all UAs that support <meter> now render it 
very close to <progress> which is IMO misleading. 

There are other elements and input widgets that have their
own states that should be styleable.

I suspect that the easiest way to add reflection of inner state 
to CSS is to use special state-*** attributes that will be 
ideologically close to data-*** attributes that we have already.
So for the <meter> we will be able to define something like 
this:
  meter[state-meter="low"] { background-color: yellow; }
  meter[state-meter="optimal"] { background-color: green; }
and meter implementation is responsible for setting this attribute.

[1] http://www.w3.org/TR/html5/the-button-element.html#the-meter-element

-- 
Andrew Fedoniouk

http://terrainformatica.com
Received on Tuesday, 13 September 2011 04:01:45 GMT

This archive was generated by hypermail 2.3.1 : Tuesday, 26 March 2013 17:20:44 GMT