[Implementersā doc] [Authorsā info]
Readium CSS is leveraging the cascade in order to provide authors with defaults, paginate contents and apply user overrides and themes. As a consequence, there is a specific order in which reflowable stylesheets must be added. Indeed, conformance with CSS Cascading and Inheritance Level 3 requires that we make authorsā stylesheets an integral part of our cascade.
Inject ReadiumCSS dist
stylesheets into the <head>
of (X)HTML documents.
ReadiumCSS-before.css
ReadiumCSS-default.css
for unstyled publicationsReadiumCSS-after.css
For RTL, you would then have to load the stylesheets in the rtl
folder. Same for CJK. Check the āInternationalizationā doc for guidance.
By default, we inject all stylesheets on load and rely on custom properties (a.k.a. CSS variables) set on html
to apply user settings.
If you want to customize dist
stylesheets, youāll have to respect the following guidelines and rebuild dist
stylesheets.
The following modules must be inserted before the authorās stylesheets (ReadiumCSS-before.css
), in this exact order:
ReadiumCSS-config.css
ReadiumCSS-base.css
ReadiumCSS-day_mode.css
ReadiumCSS-fonts.css
ReadiumCSS-html5patch.css
ReadiumCSS-safeguards.css
(or ReadiumCSS-safeguards-vertical.css
for CJK ā vertical writing mode)The following modules must be appended if there is no external stylesheet (<link>
), internal stylesheet (<style>
) or inline styles in the document (style=" "
), in this exact order:
ReadiumCSS-default.css
This default must be appended before all other modules in the next section.
The following modules must be appended after the authorās stylesheets (ReadiumCSS-after.css
), ideally in this order:
ReadiumCSS-config.css
ReadiumCSS-pagination.css
(or ReadiumCSS-pagination-vertical.css
for CJK ā vertical writing mode)ReadiumCSS-scroll.css
(or ReadiumCSS-scroll-vertical.css
for CJK ā vertical writing mode)ReadiumCSS-night_mode.css
ReadiumCSS-sepia_mode.css
ReadiumCSS-os_a11y.css
ReadiumCSS-colNumber_pref.css
(does not apply to CJK ā vertical writing mode)ReadiumCSS-pageMargins_pref.css
(or ReadiumCSS-pageMargins-vertical_pref.css
for CJK ā vertical writing mode)ReadiumCSS-customColors_pref.css
ReadiumCSS-textAlign_pref.css
(does not apply to CJK scripts)ReadiumCSS-bodyHyphens_pref.css
(does not apply to CJK scripts)ReadiumCSS-fontFamily_pref.css
ReadiumCSS-a11yFont_pref.css
(does not apply to RTL and CJK scripts)ReadiumCSS-fontSize_pref.css
ReadiumCSS-lineHeight_pref.css
ReadiumCSS-paraSpacing_pref.css
(or ReadiumCSS-paraSpacing-vertical_pref.css
for CJK ā vertical writing mode)ReadiumCSS-paraIndent_pref.css
(does not apply to CJK scripts)ReadiumCSS-wordSpacing_pref.css
(does not apply to RTL and CJK scripts)ReadiumCSS-letterSpacing_pref.css
(does not apply to RTL scripts, except in vertical writing mode)ReadiumCSS-arabicLigatures_pref.css
(RTL only)ReadiumCSS-ruby_pref.css
(CJK only)ReadiumCSS-fs_normalize.css