Re: Styling form control elements

On Thu, 5 Dec 2013, Ryosuke Niwa wrote:
> 
> Let me understand the problem of styling/replacing builtin form controls.
> 
> As I understand it, people want to do:
> 
> <select name=cities is=map>
> <option>Oakland</option>
> <option>San Francisco</option>
> <option>San Jose</option>
> ...
> </select>
> or
> <input is=switch type=checkbox ...>
> 
> to have a nice fallback when "is" / shadow DOM is not supported.
> 
> Why can't we just do:
> <map>
> <select name=cities>
> <option>Oakland</option>
> <option>San Francisco</option>
> <option>San Jose</option>
> ...
> </select>
> </map>
> and
> <switch><input type=checkbox ...></switch>
> 
> instead?

I suppose you _could_ do that, but it would mean that author-defined 
widgets would be second class citizens.

Personally what I'd like is:

 <select name=cities>
  <option>Oakland</option>
  <option>San Francisco</option>
  <option>San Jose</option>
  ...
 </select>

...with:

 select[name=cities] { binding: url(map); }
   
...in the CSS, since this is just presentation.


> What is so special about form controls or custom elements that warrant a 
> completely different mechanism?

Different than what? I'd love the markup to not be different whether or 
not we're using custom widget presentations.

-- 
Ian Hickson               U+1047E                )\._.,--....,'``.    fL
http://ln.hixie.ch/       U+263A                /,   _.. \   _\  ;`._ ,.
Things that are impossible just take longer.   `._.-(,_..'--(,_..'`-.;.'

Received on Thursday, 5 December 2013 16:50:21 UTC