readium / webpub-manifest

📜 A JSON based Web Publication Manifest format used at the core of the Readium project
BSD 3-Clause "New" or "Revised" License
91 stars 23 forks source link

Should a Web Publication be styleable? #57

Closed mickael-menu closed 5 months ago

mickael-menu commented 4 years ago

I'm spawning this issue from this conversation about non-linear resources.

Currently, only reflowable EPUB supports overriding CSS styles in Readium. We assumed that Web Publications can't be styled appropriately, since layouts are much more diverse on the web. However, maybe there's a need for book-like publications with WebPub:

There's also some interest:

I am converting some HTML files to hopefully be read by Readium. It would be easier to read and write a single JSON file rather than the several XML files that are required for a valid epub https://readium.slack.com/archives/C0AN4MN1J/p1585608890006400

Pagination could already be handled with the paginated overflow in the Presentation Hints. However, we don't have any way to authorize CSS styling in the RWPM.

A few questions remain:

llemeurfr commented 4 years ago

We currently rely on the @type (e.g. "http://schema.org/Book") for setting high level profiles and we have defined a set of presentation hints for setting lower level indications. A layout property (fixed or reflowable) has also been defined on each resource.

We could play with the layout property to decide that a (non-linear) resource is to be displayed as a modal box (with a close button), or create an additional property in the presentation hints if we don't want to mix-up things.

HadrienGardeur commented 4 years ago

I'm not comfortable with the idea of using @type to decide such things since this is not its purpose.

A Web Publication could perfectly use http://schema.org/Book yet have its own styles that shouldn't be modified in any way.

llemeurfr commented 4 years ago

I'm not comfortable with the idea of using @type

Neither do I. That's why I didn't propose that.

mickael-menu commented 4 years ago

We could play with the layout property to decide that a (non-linear) resource is to be displayed as a modal box (with a close button), or create an additional property in the presentation hints if we don't want to mix-up things.

But wouldn't regular webpages have a reflowable layout, but would still want to prevent CSS styling beyond font size?

llemeurfr commented 4 years ago

still want to prevent CSS styling beyond font size?

This I don't know, and we should be driven by real use cases before we decide so.

Note: this discussion relies on features which cannot be implemented in EPUB. Can be easily integrated in RWPM, may be ported later to W3CP with much more efforts (I know I know).

JayPanoz commented 4 years ago

This I don't know, and we should be driven by real use cases before we decide so.

Don’t know either but maybe a very naïve take for the sake of brainstorming/exploring ideas, this somehow also reminds me of web browsers’ “Reader Mode” – although I’m mentioning this because it has been regularly popping up in overrides/styling discussions during our engineering calls.

This kind of article could at least be food for thought: https://css-tricks.com/reader-mode-the-button-to-beat/

(We also know it’s really hard to nail heuristics down so it requires significant effort to create and maintain.)

Out of curiosity, I also just checked preferences in web browsers, and I had never noticed Firefox has a “can website override these settings?” checkbox/option list for user settings:

Capture d’écran 2020-04-29 à 14 37 07

Capture d’écran 2020-04-29 à 14 37 20

JayPanoz commented 4 years ago

Ah and I forgot that for web authoring, in case we need some data, we have a comprehensive list of insights from the HTTP Archive if that can help: https://almanac.httparchive.org/en/2019/

[edit] maybe with an emphasis on this chapter: https://almanac.httparchive.org/en/2019/accessibility

HadrienGardeur commented 5 months ago

Now that we have conformsTo statements and a value to identify a publication that conforms to the EPUB profile, I feel that this should be enough.

Even if a publication isn't packaged as EPUB, it could use this profile to indicate that styling is allowed.