-
Notifications
You must be signed in to change notification settings - Fork 23
Description
Since the default stylesheet is the next phase, I’d like to anticipate a little bit. It would be useful to collect feedbacks while I’m testing pagination and page margins.
Contrary to what one may think at first sight, this is something for which I’ll have to take authors expectations into account. Indeed, there is a bunch of people relying entirely on default styles (think about hr for instance) and, consequently, they won’t bother embedding a custom stylesheet. Others might rely on default styles and only customize some elements (e.g. :link color or small-capitals, etc.).
The good news is that we already have a default stylesheet, the UA’s. I validated UA stylesheets against HTML5 suggested rendering and can report there are some differences, but it doesn’t impact default styles (flow and phrasing content, quotes, headings, lists, tables, embedded content, images, etc.).
The bad news is we don’t necessarily want to use it AS-IS. HTML5 suggested rendering doesn’t have to deal with user settings (font size, line height, margins, etc.), fragmentation (i.e. page breaks, widows and orphans), hyphenation and reading modes (especially night modes).
Please note I still have to check HTML4 Suggested Rendering for ePub 2.
I can probably save us a lot of issues by adapting and modernizing HTML5 suggested rendering a little bit:
- use a smaller type scale so that headings don’t become an issue when the user sets a bigger font-size;
- redefine colors so that borders become white in night modes;
- tweak
supandsubso that they don’t break the line height; - redefine horizontal margins and paddings for block quotes, figures, lists, etc. to accommodate smartphones (
40pxis really really huge, especially when you start nesting lists since it can grow to120pxor160px); - redefine
tab-sizeso that one tab is not 8 spaces inpre(I understand why this default value but find it quite stupid considering smartphones exist); - as far as I can tell, although it’s not managed via UA stylesheets, some browsers default font-variant-* quite well but I can normalize it to make sure all UAs have the same values (that’s like 5 or 6 lines of CSS);
- take care of basic fragmentation + hyphenation.
Then the question will be “do we make it more bookish?”
Bookish implies stuff as:
- picking a font-stack and defining a font-family for
body(some UAs default to Times New Roman, which has been heavily criticized by Matthew Carter because it’s way too thin for HD displays, and it doesn’t ship with Open Type Features which could improve legibility, while more modern fonts do) - replacing paragraphs’ margins with a text indent (we would be quite possibly be breaking authors’ expectations there);
- in that case, you could also reset the text-indent for paragraphs following a heading (more elegant, visual harmony, etc.);
- Forcing
pretopre-wrapso that we don’t haveoverflow-x(probably more readable though not perfect); - centering figures;
- taking care of vertical rhythm so that page baselines are aligned, at least for text (images are another issue CSS Rhythmic Sizing is trying to solve);
- etc.
My opinion at the moment is that we should probably improve HTML5 Suggested Rendering (think about it as EPUB Suggested Rendering if this can help conceptualize it) and use themes for the bookish changes. In other words, power to the user. On the other hand, there is bookish stuff which could be part of defaults, especially declaring a font-stack since the default font-family may not support all languages (anticipating CJK/RTL there).
I know the idea is to provide default styles for unstyled publications but we could use this stylesheet to improve/help authors a little bit (thinking about Open Type, hr + night modes, etc.).
I’ll also have to deal with CJK and RTL. I’ve done some Japanese in the past, am familiar with some best practices, but it was in western publications. In other words, I’ll have to do extended research to make sure we can manage CJK and RTL well. In addition, we could probably write “best practices” for this so that it can help both implementers and authors.
On a related note, there is the W3C Typography repo which could be useful. It points to typographic information relevant to the web platform.
The “help wanted” label is precisely for CJK and RTL. I can find ressources, best practices, examples, etc. but I’d like to make sure we have bulletproof styles there. Typography experts dealing with CJK and RTL are warmly welcome to weigh in this issue, and do “styles review” once the default stylesheet is created.
For instance, my assumption is that we could manage that by targeting lang but that approach may be completely wrong for various reasons. So I’d like to know how experts manage that in practice.