Conversation
And remove RS__ from properties
|
What would be the strategy for a RS to figure out which line height compensation to use? Here's an attempt:
|
|
Yeah that makes sense as I treated it like this lately as it was the most obvious way to do it. We'd better document it for clarity. I am also thinking about the case where Latin may not be the default script of the app, in which case we should warn to not blindly apply this logic. |
Abstract the rule for app/publication instead of treating non-latin-based apps as outliers.
There was a problem hiding this comment.
Pull request overview
Exposes more ReadiumCSS variable data as published JSON/docs for external consumers, especially language-specific font-family and line-height defaults, and wires the build to generate a Markdown reference from those datasets.
Changes:
- Added new published variable datasets (
i18n.json,settings.json) and converted existing exported vars JSON files to unprefixed keys, with PostCSS now adding the--RS__prefix at build time. - Updated the base stylesheet and regenerated compiled CSS so language-specific defaults come from imported i18n data instead of hardcoded values.
- Added generated/reference documentation for the new data, updated EPUB/migration docs, and bumped the package version/build pipeline.
Reviewed changes
Copilot reviewed 15 out of 30 changed files in this pull request and generated 11 comments.
Show a summary per file
| File | Description |
|---|---|
scripts/generate-vars-doc.js |
New script to build css/vars/CSS-Variables.md from exported JSON data. |
package.json |
Adds vars-doc generation to the build and bumps package version. |
docs/ReadiumCSS_docs/OEBPS/toc.ncx |
Adds EPUB TOC entry for the new i18n migration note. |
docs/ReadiumCSS_docs/OEBPS/Text/Section-028.xhtml |
Adds EPUB migration-guide content about exposed i18n data. |
docs/ReadiumCSS_docs/OEBPS/Text/nav.xhtml |
Adds EPUB nav link for the new section. |
docs/ReadiumCSS_docs/OEBPS/content.opf |
Updates EPUB modified timestamp metadata. |
docs/CSS28-migration_guide.md |
Adds migration-guide section about i18n stacks and generated vars docs. |
css/vars/settings.json |
New published mapping of stylesheet variants to disabled/added user settings. |
css/vars/pagination.json |
Publishes pagination defaults with unprefixed JSON keys. |
css/vars/i18n.json |
New published language-to-font/line-height mapping. |
css/vars/fontStacks.json |
Publishes default/Japanese font stacks with unprefixed JSON keys. |
css/vars/CSS-Variables.md |
Generated reference document for exported CSS variable data. |
css/vars/colors.json |
Publishes color defaults with unprefixed JSON keys. |
css/src/modules/ReadiumCSS-base.css |
Switches base language defaults to imported i18n variables. |
css/postcss.config.js |
Configures JSON import plugin to prepend --RS__. |
css/dist/webPub/ReadiumCSS-webPub.css |
Regenerated webPub bundle header/version. |
css/dist/rtl/ReadiumCSS-default.css |
Regenerated RTL default bundle header/version. |
css/dist/rtl/ReadiumCSS-before.css |
Regenerated compiled RTL base bundle with imported i18n vars. |
css/dist/rtl/ReadiumCSS-after.css |
Regenerated RTL after bundle header/version. |
css/dist/ReadMe.md |
Updates published dist README content. |
css/dist/ReadiumCSS-default.css |
Regenerated default bundle header/version. |
css/dist/ReadiumCSS-before.css |
Regenerated compiled base bundle with imported i18n vars. |
css/dist/ReadiumCSS-after.css |
Regenerated after bundle header/version. |
css/dist/cjk-vertical/ReadiumCSS-default.css |
Regenerated CJK vertical default bundle header/version. |
css/dist/cjk-vertical/ReadiumCSS-before.css |
Regenerated compiled CJK vertical base bundle with imported i18n vars. |
css/dist/cjk-vertical/ReadiumCSS-after.css |
Regenerated CJK vertical after bundle header/version. |
css/dist/cjk-horizontal/ReadiumCSS-default.css |
Regenerated CJK horizontal default bundle header/version. |
css/dist/cjk-horizontal/ReadiumCSS-before.css |
Regenerated compiled CJK horizontal base bundle with imported i18n vars. |
css/dist/cjk-horizontal/ReadiumCSS-after.css |
Regenerated CJK horizontal after bundle header/version. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This creates a JSON file for language-specific values in ReadiumCSS-base module so that they can be accessible to external consumers of ReadiumCSS.
A use case would be to adjust the value you submit for line height to the Preferences API in Navigators depending on the language, or adjust font-family putting the value in the selection as sort of a default value.