- From: James Craig <jcraig@apple.com>
- Date: Thu, 15 Nov 2012 15:09:19 -0800
- To: "Tab Atkins Jr." <jackalmage@gmail.com>
- Cc: www-style@w3.org
On Nov 15, 2012, at 2:48 PM, "Tab Atkins Jr." <jackalmage@gmail.com> wrote: > On Thu, Nov 15, 2012 at 2:13 PM, James Craig <jcraig@apple.com> wrote: >> An alternate solution, that was proposed off-list, was for CSS to offer another property to indicate whether the value of the content property was considered decorative or not. >> >> .expandable:before { >> content: "\25BA"; /* a.k.a. ► */ >> generated-content: decorative; /* something like this? like adding aria-hidden="true", but applied to the psuedo-element */ >> } > > In this vein, I'm not opposed to a similar approach, where we define > an "alt" property that only applies to pseudo-elements and takes a > <string> as its value. The presence of 'alt' means that 'content' is > decorative, and you should read 'alt' instead. Absence means you > should read 'content' as normal. Just to be clear, you're talking about this, right? .expandable:before { content: "\25BA"; /* a.k.a. ► */ alt: ""; /* aria-expanded="false" already in DOM, so this pseudo-element is decorative */ } And this: .new:before { content: "\2730"; alt: attr(data-new); /* allows for localized content from the DOM, e.g. @data-new="New!" */ } I think that sounds okay, but have a few questions: 1. Should the 'alt' property only apply when content has been replaced, or would it apply at all times? .foo:before { alt: "This text only available to assistive technology?"; } /*e.g., no visibly rendered content for the pseudo-element. */ 2. Would you also expect this to override content of native DOM elements, rather than just pseudo-elements? <foo style="alt:'baz';">bar</foo> <!-- Potentially confusing to authors. I'm not sure it'd be a good idea on actual elements. --> Thanks, James PS. How should I track this request? File a bug? WG Issue?
Received on Thursday, 15 November 2012 23:09:49 UTC