Re: Is there a CSS media query for EPUB (or, later, PWP)?

> On 31 Oct 2015, at 06:56, Ivan Herman <ivan@w3.org> wrote:
> 
>> 
>> On 31 Oct 2015, at 06:15, Leonard Rosenthol <lrosenth@adobe.com> wrote:
>>> Dave,
>>>  
>>> the subject line may just show my ignorance. But is there such a beast? Should there be?
>>>  
>>> I was looking at the proposal for a new style sheet for W3C documents. A sample document is at:
>>>  
>>> http://fantasai.inkedblade.net/style/design/w3c-restyle/2016/sample
>>>  
>>> There is  really neat trick, which is based on media queries, on pushing the TOC on the left of the screen (if it is large enough), or to have a small sign on the lower left hand corner of the screen for a narrow screen. It is neat, but if the document is converted into an EPUB, it becomes unnecessary. After all, the EPUB structure requires a TOC; in many respect, that TOC on the left reproduces what Reading Systems do (and they do no matter what). The cleanest would be to control that via a media query…
>> Epub isn’t media – itmdpesnt belong in an MQ.  If you look at the differences between MQ3 and MQ4 you’ll see how they’ve (rightly) simplified it to only includes a core set of thongs
> 
> To be fair I do not really care about the terminology. MQ4 does include media types and media features and I think it is a legitimate question whether there is a way to characterize and EPUB or, eventually, similar publications. Is it a print media? An EPUB should probably be considered as a screen media type, so the question is whether there are (and whether there should be) media features that differentiate them from other presentations.

The CSS WG considers media types to be a failed idea. Quoting from the level 4 media queries spec:

> media types have proven insufficient as a way of discriminating between devices with different styling needs. Some categories which were originally quite distinct, such as screen and handheld, have blended significantly in the years since their invention. Others, such as tty or tv, expose useful differences from the norm of a full-featured computer monitor, and so are potentially useful to target with different styling, but the definition of media types as mutually exclusive makes it difficult to use them in a reasonable manner; instead, their exclusive aspects are better expressed as media features such as grid or scan.

Another thing that makes media features far superior to media types is that they are future proof, as they enable authors to write styles that work well on devices they have not anticipated, by reacting to the relevant characteristics of these devices.

The CSS WG will not add more media types, and is actively deprecating most of the existing ones. So an "epub" media type is pretty much out of question. On the other hand, media features to expose what makes an epub reader different from another medium are very much in scope.

We already have a few media features that should help authors make their styles conditional on distinctive aspects of (some) epub readers:

- scripting: tell apart UAs with and without javascript support

- pointer / hover: react to the type of pointing device

- update-frequency: differentiate between media that never changes once rendered (paper), those that can change but not animate (e-ink), and those that can change in real time (regular screens)

- overflow-block / overflow:inline: are we in a paged medium, or a scroll medium (plus additional subtleties)

I encourage you (and other people in the IG) to look at section 4,5,6,7,8 and 9 of the media queries level 4 specification (https://drafts.csswg.org/mediaqueries/#mf-dimensions). If you think that there are distinctive aspects of epub reading systems that authors would like to react to, but are not covered by the media features already specified, this would be valuable feedback to the CSSWG.

Based on your original mail, I suppose you'd like to see a media feature that would let you react to the UA/environment providing a table of contents. This might be worth looking into. We should probably start by gathering various use cases to see how the different media with TOCs behave, to figure out if this is an on/off switch, or if there are more variants (or if this is the correct axis at all). For example, we should look at different epub readers, pdf renderers, assistive technologies...

 - Florian

Received on Saturday, 31 October 2015 03:44:08 UTC