Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Handling missing prefixed CSS properties #44

Open
JayPanoz opened this issue Apr 30, 2018 · 0 comments
Open

Handling missing prefixed CSS properties #44

JayPanoz opened this issue Apr 30, 2018 · 0 comments

Comments

@JayPanoz
Copy link
Collaborator

This is the crux of issue #19 about vertical-writing so I decided to open a more specific issue.

To put things simply, a lot of stylesheets won’t ship with all the necessary prefixed and/or unprefixed properties, especially the -epub-props, which can create quite a visible issue with writing-mode, and some others as well.

In the alpha version of ReadiumCSS, we’re enforcing writing-mode when needed, based on a chain of educated guesses (language of the publication, page-progression-direction, etc.) but that’s at the document :root level, and doesn’t take children into account.

And there’s a lot more:

  • text-emphasis
  • text-orientation
  • text-combine-upright
  • word-break
  • line-break
  • hyphens
  • text-transform
  • etc.

See this mappings table in this PostCSS plugin (which is a proof of concept).

From Laurent:

A radical solution would be to avoid treating such issues "on the fly", but as a "repair" action activated by the user himself. Because after all, the culprit is the missing standard CSS property, and this should be solved once for all in the EPUB file.
To do this, we would have to a/ developer a "repair" (or "cleaning") lib b/ offer it as a command line tool and/or c/ plug it into the Readium test apps in some way.

I really can’t see any other way than preprocessing stylesheets to add the missing properties, to be honest, since unsupported properties can’t be retrieved using getComputedStyle.

This primarily impacts Gecko/Quantum and Trident/EdgeHTML so we’re talking about web apps there, although some developers could decide to use the native Windows WebView – also heard about an Electron-like framework built on top of Quantum but I can’t find any info about that right now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant