[csswg-drafts] [css-content] Clearer syntax for alternative text for content (#3899)

dot-miniscule has just created a new issue for https://github.com/w3c/csswg-drafts:

== [css-content] Clearer syntax for alternative text for content ==
The [spec](https://drafts.csswg.org/css-content/#alt) states that alternative text can be supplied for CSS generated content with the following syntax:

```html
.new::before {
 content: url(./img/star.png) / "New!";
}
```

While there is developer support for this feature, it is not obvious to the content author what the purpose of the alt text declared in style is for. This has led to the suggestion that wrapping the alternative text it in `alt()` would make the intended purpose much more obvious and meaningful:

```html
.new::before {
 content: url(./img/star.png) / alt("New!");
}
```

 It looks like this was [originally discussed/considered](https://lists.w3.org/Archives/Public/www-style/2016May/0109.html),  and it would be good to revisit this. I was unable to find any specific justifications as to why the `alt()` syntax was passed over in favor of what's in the spec so I'd just like to open it up to discussion now. Depending on the outcome of discussion, I'd be happy to draft a PR on the spec to update the syntax.

Concerns from TAG review of this syntax can be seen here: https://lists.w3.org/Archives/Public/www-style/2016May/0109.html

Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/3899 using your GitHub account

Received on Wednesday, 8 May 2019 06:31:16 UTC