readium / readium-css

🌈 A set of reference stylesheets for EPUB Reading Systems, starting with Readium Mobile
https://readium.org/readium-css/
BSD 3-Clause "New" or "Revised" License
90 stars 20 forks source link

CSS3-break use cases and support #52

Closed ppKrauss closed 5 years ago

ppKrauss commented 6 years ago

I'm submitting a feature request: to add some CSS3-break reference stylesheets.

Short description of the issue/suggestion:

CSS3-break standard will be slowly incorporated to web browsers... But is a crucial element to differenciate usual web page from "good paged media", is a key feature for the professional use of EPUB — as competitor for PDF, Kindle, etc. in publishing and digital preservation perspectives.

JayPanoz commented 6 years ago

I must admit I’m failing to see why this might be handled by the Reading App itself. Shouldn’t this be entirely up to authors?

I mean, ReadiumCSS is meant to be used by Reading Systems on top of a webview/browser so support for css3-break ships with those web views/browsers and can be used out of the box so there’s nothing preventing authors from using them in their stylesheets. See also the first half of this issue for more details and a current interop issue.

If we had a stylesheet using breaks e.g. break-before the h2 elements by default, that would even break authors’ expectations. Am I missing something there?

A better question probably: what would be the use cases in which Reading Systems would need such a stylesheet?

JayPanoz commented 5 years ago

@ppKrauss Anything you’d like to add there? I’m still not sure what the original expectation was


Either this is strictly about ReadiumCSS and that’s something we don’t want to implement because it’s up to authors and we don’t want to risk overriding their styles.

Or this is about missing/lacking support in apps, in which case issues should be reported in their dedicated repo (Desktop, iOS, Android).

ppKrauss commented 5 years ago

Hi @JayPanoz, thanks all reply!

Hum... We need some "common and consensual semantics"... There are some approaches, what you prefer?


I see some misconceptions, my, about objective/implementation in this project; yours, about real necessity to adopt recent standards (CSS3-break)... Let's restart to check our visions...

  1. "The major goal of Readium CSS is to provide implementers and authors with reliable and modern styles"ref, and, ok, I am interesting only in "EPUB 3 publications" and the "with good interoperability" parts.

    1.1. How to implement this goal in the project? Supposing "by example" and "by test". ReadiumCss is suggesting default behaviours and offering EPUB samples to test visualization... ReadiumCss is a kind of requirements specification for EPUB readers (default-style and minimal CSS interpretation).
    So, by my "lets use CSS3-break" perspective, I can suggest inclusion of samples and little changes in the defaults.

  2. "Those stylesheets were not designed and should not be used for other existing formats"... The CSS3-break is not "works in progress", starting as CSS-paged was a 10-year-waiting to good pagination, etc. ... CSS3-break was a de facto standard for Prince, etc. engines (HTML-to-PDF converters), and now is a de jure W3C standard, for any html-engine.

    2.1. ...And the only community that can enhance adoption of CSS3-break is the OpenAccess, OpenSource, etc. (not Amazon, Adobe, Elsevier, etc. interested in the no-adoption). So supposing that CSS3-break is a strategic goal here in the readium-css project... Without strategic view perhaps I lost the context of my initial feature request.

  3. The project's documentation use wrong hypothesis, as at "pagination", because at that time CSS3-break not exists... Now must to split into [old browser] and [new browser] requirement (eg. a new sample EPUB for print-media engine).

  4. .... Is it, some misconceptions? Others?

JayPanoz commented 5 years ago

OK thanks for those clarifications. Allow me to address each point in further details.

can I send a zip with the OEBPS/Text folder with some CSS3-break styles to show things and talk about?

You can if you wish (readium-css [at] edrlab [dot] org) but we have a lot of files using CSS-break already so please be assured we’re aware this is a thing authors want.

can you install something like Prince and test print-css.rocks (simulating EPUB and comparing with PDF)?

This is something far outscoping ReadiumCSS per se. What we’re talking about here is getting the apps “polyfilling” what’s missing @ the Web Browser/Web View level – so that’s not CSS, that’s native/JS. I’m not in charge of that part, I can only advise app developers if needed there.

"The major goal of Readium CSS is to provide implementers and authors with reliable and modern styles"

OK I can see we poorly worded that. It should be more like “The major goal of Readium CSS is to provide implementers with reliable and modern styles, which don’t override authors’ styles unless strictly necessary.”

In some sense, authors are indirectly involved in Readium CSS. What we’ve been trying to achieve is designing our styles (pagination, defaults for unstyled ebooks, user settings) so that they don’t interfere with authors’ styles too much (i.e. overrides) and provide guidelines so that it stays like this.

ReadiumCss is suggesting default behaviours and offering EPUB samples to test visualization...

Indeed, but only to implementers, for Reading Apps’ features – and not CSS specs, which are de facto delegated to browsers. EPUB features are delegated to IDPF samples, that we’re also using.

See how we handled hyphens: auto for instance.

"Those stylesheets were not designed and should not be used for other existing formats"

Other existing formats = CBZ, Kindle Mobi, FictionBook 2, etc. This just means those styles were meant for EPUB (2 and 3) and EPUB only.

So supposing that CSS3-break is a strategic goal here in the readium-css project...

Once again, this is delegated to Web Browsers/Web Views. I can see you’re participating in the Chromium issue so to put it simply, all I could do there is expressing our interest as well but then, it’s up to Chromium devs to implement it. Our options are:

  1. either we’re just waiting for the implementation
  2. or we decide to polyfill that in the Reading Apps until it is finally implemented (which may never happen because browsers have business strategies and it simply doesn’t fit in their vision).

The project's documentation use wrong hypothesis, as at "pagination", because at that time CSS3-break not exists...

This wasn’t an hypothesis, that’s pretty much the standard implementation right now i.e. how reading apps are mocking Pagination – because browsers don’t support it and content fragmentation is lacking anyway so that’s a huge task.

For instance, even the Pagination API that iBooks is using on iOS is built on top of CSS3 multicol (emphasis mine). Apps which don’t use multicol typically rely on EPUB contents alteration to get their “pagination logic” working – the exception being Edge, which uses CSS Regions.

cc @llemeurfr If I’m understanding correctly, this goes back to “Layout in JS” – so a huge polyfill on top of browsers, reimplementing all the fragmentation’s logic, perf issues to monitor, edge cases, etc.

JayPanoz commented 5 years ago

Sorry, “Pagination in JS” should have been “Layout in JS” in the previous comment.