3 ms·
On a related note, I think the HTML spec should explicitly define default styles for each type of input. Each input should also be fully customizable with CSS r
by blehn 16y ago
On a related note, I think the HTML spec should explicitly define default styles for each type of input. Each input should also be fully customizable with CSS rules (I'm looking at you, radio, checkbox, and select). It's a pain in the ass to make a form look good, and using JS to replace the inputs is a hacky solution. All the major browser makers use custom input styles on their own websites — clearly, inheriting the styles of the operating system is nonsense. (if OS styles are to be inherited, at least make them easy to modify with CSS).
- glenjamin 16y agoThis is the main reason I cannot see myself using HTML5 form validations - they look awful and inconsistent across user agents.
- lambda 16y agoThere has been a good deal of talk over the years of making form controls stylable[1]; a few, like buttons, already are, and WebKit has some vendor-specific extensions for things like scrollbars[2]. But it will take quite a bit of work to hash out standards, and a lot of implementation work in all of the major browsers to get it there. The WebKit scrollbars use a whole bunch of pseudo-elements and pseudo-classes, but there's also a possibility that the functionality for reaching inside controls and interacting with their individual parts may be exposed through a shadow DOM[3]. As mentioned in the shadow DOM post, there's a lot of work needed to be done discussing, standardizing, and implementing these features. I'd encourage people interested to get involved on www-style and public-webapps at the W3C, and the WHATWG mailing list (avoid public-html at the W3C, it appears to be purely political at this point), or get involved in one of the open-source browser engines implementing experimental versions of this stuff to give a starting point for discussion. [1]: http://goo.gl/i1eL9 http://goo.gl/i1eL9 [2]: http://www.webkit.org/blog/363/styling-scrollbars/ http://www.webkit.org/blog/363/styling-scrollbars/ [3]: http://glazkov.com/2011/01/14/what-the-heck-is-shadow-dom/ http://glazkov.com/2011/01/14/what-the-heck-is-shadow-dom/
- rimantas 16y agoHTML should not specify styles for anything. If you want that from HTML you don't understand what HTML is. Nothing stops you from targeting different inputs with CSS right now with attribute selectors (e.g. input[type="url"]). As for whether it is a good idea to style inputs differently from defaults users are used to, that's still a topic for discussion.
- bzbarsky 16y agoNote that for some inputs (e.g. type="file") different UAs make them look totally different. And they might need to look different based on the input modality and so forth. We could specify a forced lowest-common-denominator behavior of some sort, but that seems like a disservice to users.