pressbooks / pressbooks-book

McLuhan is the default book theme for Pressbooks.
https://pressbooks.org
GNU General Public License v3.0
20 stars 16 forks source link

Feature: Add support for -webkit-hyphens & -ms-hyphens #779

Open SteelWagstaff opened 3 years ago

SteelWagstaff commented 3 years ago

Description

Reported by Thomas Dumm:

I looked at a book (using the Malala theme) on my iphone with iOS13. I noticed that the justified text had many large “holes” and that no hyphenation was happening on the iphone despite the hyphens: auto CSS rule. I then added -webkit-hyphens: auto to the custom css and the justified text looked nice on the iphone too. Apparently iOS (also the latest version 13) only knows -webkit-hyphens. So maybe it makes sense to add -webkit-hyphens auto to the right place in the theme css (or in buckram?). Maybe include the -ms prefixes too?

https://caniuse.com/#feat=css-hyphens

Hyphens are set in McLuhan in a few places (https://github.com/pressbooks/pressbooks-book/blob/46e41fb60b177edf3db32991e8561a5bc35899bd/packages/buckram/assets/styles/components/elements/_paragraphs.scss#L31-L40 https://github.com/pressbooks/pressbooks-book/blob/d583abdb88ca81cd3354daaa258450197fa48793/assets/styles/components/_elements.scss#L114 https://github.com/pressbooks/pressbooks-book/blob/c7f49495bc54e239f4287bed8c71d41eab81abd1/packages/buckram/assets/styles/variables/_elements.scss#L635

It also looks like several themes use -webkit-hyphens. See https://github.com/search?q=org%3Apressbooks+%22-webkit-hyphens%22&type=Code

SteelWagstaff commented 2 years ago

We removed justification from the Malala theme. Need to see if the hyphen issue still persists.