CSS3 Generated and Replaced Content

Skip to first unread message

Domenic Denicola

Nov 10, 2011, 1:10:31 AM11/10/11
to jquery-s...@googlegroups.com
A while back I found the CSS3 Generated and Replaced Content Working Draft. I was ecstatic! The pseudo elements described in that draft would allow me to do great things, subsuming many unsemantic <div>s and <span>s into generated content. ::before::before? ::before(2)? ::outside? So excellent!

... but, as far as I can tell, basically nothing is supported. I think if more people were aware of the awesomeness in this draft, they'd be pretty excited about getting it implemented. So I thought I'd bring it to the attention of the group here.

Example use case: styling HTML5 <menu> and <command> elements. A <command> can have multiple decorations: an icon (drawn from the icon attribute); the text itself (drawn from the label attribute); a marker to denote the presence or absence of submenus; a checkbox or radio button indicator (depending on the type attribute)... With CSS2.1 generated content, only two of these could be shown without starting to insert <span>s with JavaScript. (Which is actually not possible, since <command> is an empty element. So we end up transforming the <command>s into <a>s and it's all just a huge sad mess.) With CSS3 generated and replaced content, all of these could be implemented.

Anyone else hoping this draft gets some love?
Reply all
Reply to author
0 new messages