Comments (11)
I may have found a way to handle both
<span id="page001" title="1" epub:type="pagebreak"/>
and
<span epub:type="pagebreak" id="page001" class="whatever">1</span>
using some weird selectors e.g. [epub|type="pagebreak"]:not(:empty)
and [epub|type="pagebreak"][title]:empty
. If there is whitespace though, :empty
won’t work..
from readium-css.
high page numbers → there is a possibility the margin could not be large enough to accommodate 3+ numbers very well
One possibility there, as 2+ digits can already be an issue on small and narrow screens, and 3+ digits on desktop would be to lay out page numbers with a writing-mode of vertical-lr
(or a rotate
transform).
That could also solve
kind of an edge case but we should also probably take into account that numbers in margins can also be used to number lines or paragraphs in some publications (plays, STEM, etc.).
Now,
should the font-size increase with the content’s?
Probably not, given the issue illustrated above.
from readium-css.
I must say I like this vertical solution, as it also avoid confusion with synthetic page numbers in the footer and may accomodate other (longer) strings included as "page-breaks".
from readium-css.
In reply to @JayPanoz :
If there is whitespace though,
:empty
won’t work.
Yes, until perhaps when CSS text-space-collapse: discard
is supported? https://drafts.csswg.org/css-text-4/#white-space-collapsing
from readium-css.
To be honest, I was more focused on the :blank
pseudo class, which builds upon :empty
(cf. css-tricks), longer-term, but that could be another option.
from readium-css.
Quick question though: wouldn’t this (using pseudo elements) mess with the DOM Range?
from readium-css.
For further reference, here is the whitespace we get @ 1
and 0.5
(page margin setting) on a smartphone…
A factor of 1
(default) will already be quite difficult to deal with, 0.5
seems quite frankly impossible.
from readium-css.
From page numbering best practices
go to page functionality is a must, but announcement of page numbers while reading is optional.
This will at the very least require we alter the DOM at runtime depending on the user pref, e.g. announcement on:
<span epub:type="pagebreak" id="page001" class="whatever">1</span>
Announcement off:
<span epub:type="pagebreak" id="page001" class="whatever" aria-hidden="true">1</span>
There’s no way we can manage that using speak: none
in CSS given its support.
Please note we shouldn’t even try using aria-label
on the other markup, as it generally won’t work across all browser/assistive technology combinations with a span
…
Of course if we feed the speech API via JS for TTS, we can ignore/include epub:type="pagebreak"
but for app developers willing to rely entirely on the native TTS, we need a solution.
from readium-css.
Note that the notion of "skipping" elements during linear reading order / audio playback progression is documented in EPUB3 Media Overlays: http://www.idpf.org/epub/31/spec/epub-mediaoverlays.html#sec-skippability
This concept ; as Avneesh Singh alluded to in the aforementioned discussion thread ( w3c/publ-cg#43 (comment) ) ; actually originates from the DAISY specification for Digital Talking Books, which in fact provides content creators finer "skippability" control, compared with EPUB3 MO (in other words, the EPUB3 "read aloud" functionality is slightly less capable, due to simplification necessities).
As @JayPanoz said, a general-purpose screen reader (e.g. NVDA, Jaws, Narrator, etc.) will usually not be capable of inferring the "skippable" nature of DOM elements, unlike the dedicated TTS sub-system of a reading app which would typically associate epub:type="pagebreak"
with skippability semantics ... thus why aria-hidden
+ CSS display: none
might well be the only true "portable" solution.
from readium-css.
(Off topic about aria-label
in span
with screen readers)
We needed to use this technique for a particular case a year ago and we adopted it after some positive tests:
- NVDA / Readium Chrome's extension (fresh test: Readium Desktop is fine too)
- VoiceOver / Lisa Reader (iBooks is buggy, read the 'alt' span sometimes but didn't most of time)
- Talkback / several readers.
from readium-css.
As discussed during the Readium Engineering Call on June 3rd, we think it’s better to let Reading Systems handle these styles as implementations may vary. Daniel summed the situation up in his comment above, so we’re closing this issue.
from readium-css.
Related Issues (20)
- `-webkit-perspective: 1` kills performance in CSS column paginated large HTML documents HOT 11
- EPUB with `overflow-x: hidden` style breaks pagination HOT 12
- CSS HTML5 patch causes some digits to descent from baseline HOT 4
- CSS HTML5 patch causes some digits to descent from baseline
- CSS HTML5 patch causes some digits to descent from baseline
- Long hyperlinks overlap on the next column HOT 3
- forcing "start" text alignment (left or right depending on document language) does not work with "inherit" HOT 1
- Overflow on long words HOT 4
- in scroll mode, "page width" (line length) is too short HOT 19
- Target for Browser/Webview support? HOT 3
- Dist stylesheets and minification HOT 4
- Default Stylesheet for non-reflowable EPUB contents e.g. reading mode HOT 2
- ReadiumCSS Reset/Unset
- Fonts update HOT 2
- Letter-spacing for japanese HOT 9
- Overview of new CSS specs of interest HOT 2
- Improve handling of body overflow HOT 1
- Defining design guidelines based on CSS support HOT 2
- User setting to disable/hide ruby
- Park support of pagination for vertical writing
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from readium-css.