UNS: [Moderator Action] [css-pseudo] allowed values for CSS alt

Bruce Lawson brought the new alt attribute for generated content to my 
attention on Twitter[1]. With all these icon fonts that float around the 
web, I think it is a good thing you can specify an alt text. This does 
bring up some concerns, though. As Bruce stated on Twitter[2]:

> Content in CSS *is* yuck. But the foo:before {content: "blah"} ship 
> has sailed.

I do agree that content in CSS is yuck, but can definitely see the 
advantages of generated content. 'content:' within ::before and ::after 
takes a couple of values, one of which is 'attr(<identifier>)' [3]. This 
way you can use the content of an attribute on the element the rule 
applies to. I suggest we add the same value to the 'alt' attribute [4]. 
This could help with translations, but also uphold one of the core 
principles of the web:

> Separation of Concerns
>
> HTML should allow separation of content and presentation. [5]

—Michiel Bijl

[1]: https://twitter.com/brucel/status/529920245126164480
[2]: https://twitter.com/brucel/status/529926547189534720
[3]: 
http://www.w3.org/TR/2009/CR-CSS2-20090908/generate.html#propdef-content
[4]: http://dev.w3.org/csswg/css-pseudo/#alt-property
[5]: 
http://www.w3.org/TR/html-design-principles/#separation-of-concerns

Received on Thursday, 27 November 2014 15:49:05 UTC