[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.cssReadiumCSS-default.css for unstyled publicationsReadiumCSS-after.cssFor 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.cssReadiumCSS-base.cssReadiumCSS-fonts.cssReadiumCSS-html5patch.cssReadiumCSS-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.cssThis 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.cssReadiumCSS-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-colNumber_pref.css (does not apply to CJK ā vertical writing mode)ReadiumCSS-lineLength_pref.css (or ReadiumCSS-lineLength-vertical_pref.css for CJK ā vertical writing mode)ReadiumCSS-customColors_pref.cssReadiumCSS-textAlign_pref.css (does not apply to CJK scripts)ReadiumCSS-bodyHyphens_pref.css (does not apply to CJK scripts)ReadiumCSS-fontFamily_pref.cssReadiumCSS-a11yFont_pref.css (does not apply to RTL and CJK scripts)ReadiumCSS-fontSize_pref.cssReadiumCSS-lineHeight_pref.cssReadiumCSS-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 CJK scripts)ReadiumCSS-letterSpacing_pref.css (does not apply to RTL scripts, except in vertical writing mode)ReadiumCSS-ligatures_pref.css (RTL only)ReadiumCSS-variableFont_pref.css (this contains optical sizing, weight and width prefs)ReadiumCSS-ruby_pref.css (CJK only)ReadiumCSS-imageFilters_pref.cssReadiumCSS-fs_normalize.cssReadiumCSS-iPadOS_patch.css