[webvtt] Have tags for specifying color and background color

zcorpan has just created a new issue for 
https://github.com/w3c/webvtt:

== Have tags for specifying color and background color ==
See https://github.com/w3c/webvtt/pull/261#issuecomment-158187662

Again I suppose this would be needed on the cue level as well as on 
the element level, if it should be possible to override the default 
background color.

I don't particularly like adding new elements for color, it seems like
 it would be better to be able to set colors on any element, like you 
can set classes on any element.

We could allow color specifiers at the end of start tags, as 
annotations. For elements that already require annotations, we could 
make a "#" switch from annotation to color. (It would be possible to 
write stylesheets that work in legacy clients using `^=` attribute 
selector, e.g. `v[voice^=Roger].)

```
WEBVTT

00:00:00.000 --> 00:00:10.000.foo.bar align:left #FFF #000
<v.foo.bar Roger #FFF #000>Hello
```

The cue itself has classes "foo" and "bar", color "\#FFF", background 
color "\#000".
The `v` element has the same classes, annotation "Roger", same colors.

To support non-opaque colors, we can use hex annotation with 4 or 8 
characters (this is supported in CSS now, per spec at least). e.g. 
fully transparent black is \#0000 or \#00000000. 
https://drafts.csswg.org/css-color/#hex-notation

The colors specified this way would be overridable with CSS, so it's 
like HTML `<font color>`, not like `style="..."`.

Please view or discuss this issue at 
https://github.com/w3c/webvtt/issues/272 using your GitHub account

Received on Thursday, 19 November 2015 22:16:44 UTC