[css-pseudo] How do you solve a problem like alt?

How do you hold a moonbeam in your hand?

Leaving aside *whether* we should supply alternative text in CSS, and 
which module it would appear in (both good questions - I’d just like to 
focus the thread), how would this be best expressed? I’m leaning slightly 
toward B at the moment. Any other opinions?

A. An alt property. I added this to the draft because that’s where the 
thread from two years ago ended up. It’s a nice mapping to the attribute, 
but does have issues with maintainability. It’s possible to change the 
content property without updating the alt property, and have the two get 
out of sync.

content: "\25BA";
alt: "";



B. An additional value to the content property. I’m assuming this would be 
separated by an ‘alt’ keyword. This solves the maintainability issue at 
the cost of a slightly more complex content value. This provides a single 
alt text for the entire content value - multiple images and/or strings 
would have to concatenate their alt text representations. 

content: "\25BA" alt "";

C. An additional value to the image() function. This was proposed but I 
don’t think it works well. It does allow for separate alt text for each 
individual image. But it does not solve the case where the content 
property is text or an icon, and it’s a bit confusing that you can supply 
an ignored alt text in image() functions that aren’t used in a content 
value.


Thanks,

Alan

Received on Monday, 10 November 2014 21:31:44 UTC