diff --git a/.github/workflows/playwright.yml b/.github/workflows/playwright.yml index c2062eb..265d557 100644 --- a/.github/workflows/playwright.yml +++ b/.github/workflows/playwright.yml @@ -3,8 +3,14 @@ name: Playwright Visual Regression on: push: branches: ["develop"] + paths: + - "css/src/**" + - "css/vars/**" pull_request: branches: ["develop"] + paths: + - "css/src/**" + - "css/vars/**" jobs: test: diff --git a/css/dist/ReadiumCSS-after.css b/css/dist/ReadiumCSS-after.css index 93ef8b4..020aff7 100644 --- a/css/dist/ReadiumCSS-after.css +++ b/css/dist/ReadiumCSS-after.css @@ -1,5 +1,5 @@ /*! - * Readium CSS v.2.0.4 + * Readium CSS v.2.0.5 * Copyright (c) 2017–2026. Readium Foundation. All rights reserved. * Use of this source code is governed by a BSD-style license which is detailed in the * LICENSE file present in the project repository where this source code is maintained. diff --git a/css/dist/ReadiumCSS-before.css b/css/dist/ReadiumCSS-before.css index 0d37448..4271373 100644 --- a/css/dist/ReadiumCSS-before.css +++ b/css/dist/ReadiumCSS-before.css @@ -1,5 +1,5 @@ /*! - * Readium CSS v.2.0.4 + * Readium CSS v.2.0.5 * Copyright (c) 2017–2026. Readium Foundation. All rights reserved. * Use of this source code is governed by a BSD-style license which is detailed in the * LICENSE file present in the project repository where this source code is maintained. @@ -144,11 +144,11 @@ --RS__am-baseFontFamily:Kefa, Nyala, Roboto, Noto, 'Noto Sans Ethiopic', serif; - --RS__default-lineHeightCompensation:1; + --RS__latin-lineHeightCompensation:1; - --RS__default-baseFontFamily:var(--RS__oldStyleTf); - --RS__baseFontFamily:var(--RS__default-baseFontFamily); - --RS__lineHeightCompensation:var(--RS__default-lineHeightCompensation); + --RS__latin-baseFontFamily:var(--RS__oldStyleTf); + --RS__baseFontFamily:var(--RS__latin-baseFontFamily); + --RS__lineHeightCompensation:var(--RS__latin-lineHeightCompensation); --RS__baseLineHeight:calc(1.5 * var(--RS__lineHeightCompensation)); --RS__selectionTextColor:inherit; diff --git a/css/dist/ReadiumCSS-default.css b/css/dist/ReadiumCSS-default.css index 2b17915..b541add 100644 --- a/css/dist/ReadiumCSS-default.css +++ b/css/dist/ReadiumCSS-default.css @@ -1,5 +1,5 @@ /*! - * Readium CSS v.2.0.4 + * Readium CSS v.2.0.5 * Copyright (c) 2017–2026. Readium Foundation. All rights reserved. * Use of this source code is governed by a BSD-style license which is detailed in the * LICENSE file present in the project repository where this source code is maintained. diff --git a/css/dist/cjk-horizontal/ReadiumCSS-after.css b/css/dist/cjk-horizontal/ReadiumCSS-after.css index 0151201..ec07373 100644 --- a/css/dist/cjk-horizontal/ReadiumCSS-after.css +++ b/css/dist/cjk-horizontal/ReadiumCSS-after.css @@ -1,5 +1,5 @@ /*! - * Readium CSS v.2.0.4 + * Readium CSS v.2.0.5 * Copyright (c) 2017–2026. Readium Foundation. All rights reserved. * Use of this source code is governed by a BSD-style license which is detailed in the * LICENSE file present in the project repository where this source code is maintained. diff --git a/css/dist/cjk-horizontal/ReadiumCSS-before.css b/css/dist/cjk-horizontal/ReadiumCSS-before.css index 0d37448..4271373 100644 --- a/css/dist/cjk-horizontal/ReadiumCSS-before.css +++ b/css/dist/cjk-horizontal/ReadiumCSS-before.css @@ -1,5 +1,5 @@ /*! - * Readium CSS v.2.0.4 + * Readium CSS v.2.0.5 * Copyright (c) 2017–2026. Readium Foundation. All rights reserved. * Use of this source code is governed by a BSD-style license which is detailed in the * LICENSE file present in the project repository where this source code is maintained. @@ -144,11 +144,11 @@ --RS__am-baseFontFamily:Kefa, Nyala, Roboto, Noto, 'Noto Sans Ethiopic', serif; - --RS__default-lineHeightCompensation:1; + --RS__latin-lineHeightCompensation:1; - --RS__default-baseFontFamily:var(--RS__oldStyleTf); - --RS__baseFontFamily:var(--RS__default-baseFontFamily); - --RS__lineHeightCompensation:var(--RS__default-lineHeightCompensation); + --RS__latin-baseFontFamily:var(--RS__oldStyleTf); + --RS__baseFontFamily:var(--RS__latin-baseFontFamily); + --RS__lineHeightCompensation:var(--RS__latin-lineHeightCompensation); --RS__baseLineHeight:calc(1.5 * var(--RS__lineHeightCompensation)); --RS__selectionTextColor:inherit; diff --git a/css/dist/cjk-horizontal/ReadiumCSS-default.css b/css/dist/cjk-horizontal/ReadiumCSS-default.css index 20c1dcc..2cef48f 100644 --- a/css/dist/cjk-horizontal/ReadiumCSS-default.css +++ b/css/dist/cjk-horizontal/ReadiumCSS-default.css @@ -1,5 +1,5 @@ /*! - * Readium CSS v.2.0.4 + * Readium CSS v.2.0.5 * Copyright (c) 2017–2026. Readium Foundation. All rights reserved. * Use of this source code is governed by a BSD-style license which is detailed in the * LICENSE file present in the project repository where this source code is maintained. diff --git a/css/dist/cjk-vertical/ReadiumCSS-after.css b/css/dist/cjk-vertical/ReadiumCSS-after.css index 1848a01..5b8d2e2 100644 --- a/css/dist/cjk-vertical/ReadiumCSS-after.css +++ b/css/dist/cjk-vertical/ReadiumCSS-after.css @@ -1,5 +1,5 @@ /*! - * Readium CSS v.2.0.4 + * Readium CSS v.2.0.5 * Copyright (c) 2017–2026. Readium Foundation. All rights reserved. * Use of this source code is governed by a BSD-style license which is detailed in the * LICENSE file present in the project repository where this source code is maintained. diff --git a/css/dist/cjk-vertical/ReadiumCSS-before.css b/css/dist/cjk-vertical/ReadiumCSS-before.css index 587acbe..b6708f4 100644 --- a/css/dist/cjk-vertical/ReadiumCSS-before.css +++ b/css/dist/cjk-vertical/ReadiumCSS-before.css @@ -1,5 +1,5 @@ /*! - * Readium CSS v.2.0.4 + * Readium CSS v.2.0.5 * Copyright (c) 2017–2026. Readium Foundation. All rights reserved. * Use of this source code is governed by a BSD-style license which is detailed in the * LICENSE file present in the project repository where this source code is maintained. @@ -144,11 +144,11 @@ --RS__am-baseFontFamily:Kefa, Nyala, Roboto, Noto, 'Noto Sans Ethiopic', serif; - --RS__default-lineHeightCompensation:1; + --RS__latin-lineHeightCompensation:1; - --RS__default-baseFontFamily:var(--RS__oldStyleTf); - --RS__baseFontFamily:var(--RS__default-baseFontFamily); - --RS__lineHeightCompensation:var(--RS__default-lineHeightCompensation); + --RS__latin-baseFontFamily:var(--RS__oldStyleTf); + --RS__baseFontFamily:var(--RS__latin-baseFontFamily); + --RS__lineHeightCompensation:var(--RS__latin-lineHeightCompensation); --RS__baseLineHeight:calc(1.5 * var(--RS__lineHeightCompensation)); --RS__selectionTextColor:inherit; diff --git a/css/dist/cjk-vertical/ReadiumCSS-default.css b/css/dist/cjk-vertical/ReadiumCSS-default.css index 7a12e16..d2fe289 100644 --- a/css/dist/cjk-vertical/ReadiumCSS-default.css +++ b/css/dist/cjk-vertical/ReadiumCSS-default.css @@ -1,5 +1,5 @@ /*! - * Readium CSS v.2.0.4 + * Readium CSS v.2.0.5 * Copyright (c) 2017–2026. Readium Foundation. All rights reserved. * Use of this source code is governed by a BSD-style license which is detailed in the * LICENSE file present in the project repository where this source code is maintained. diff --git a/css/dist/rtl/ReadiumCSS-after.css b/css/dist/rtl/ReadiumCSS-after.css index 806c058..3d6a5eb 100644 --- a/css/dist/rtl/ReadiumCSS-after.css +++ b/css/dist/rtl/ReadiumCSS-after.css @@ -1,5 +1,5 @@ /*! - * Readium CSS v.2.0.4 + * Readium CSS v.2.0.5 * Copyright (c) 2017–2026. Readium Foundation. All rights reserved. * Use of this source code is governed by a BSD-style license which is detailed in the * LICENSE file present in the project repository where this source code is maintained. diff --git a/css/dist/rtl/ReadiumCSS-before.css b/css/dist/rtl/ReadiumCSS-before.css index 0d37448..4271373 100644 --- a/css/dist/rtl/ReadiumCSS-before.css +++ b/css/dist/rtl/ReadiumCSS-before.css @@ -1,5 +1,5 @@ /*! - * Readium CSS v.2.0.4 + * Readium CSS v.2.0.5 * Copyright (c) 2017–2026. Readium Foundation. All rights reserved. * Use of this source code is governed by a BSD-style license which is detailed in the * LICENSE file present in the project repository where this source code is maintained. @@ -144,11 +144,11 @@ --RS__am-baseFontFamily:Kefa, Nyala, Roboto, Noto, 'Noto Sans Ethiopic', serif; - --RS__default-lineHeightCompensation:1; + --RS__latin-lineHeightCompensation:1; - --RS__default-baseFontFamily:var(--RS__oldStyleTf); - --RS__baseFontFamily:var(--RS__default-baseFontFamily); - --RS__lineHeightCompensation:var(--RS__default-lineHeightCompensation); + --RS__latin-baseFontFamily:var(--RS__oldStyleTf); + --RS__baseFontFamily:var(--RS__latin-baseFontFamily); + --RS__lineHeightCompensation:var(--RS__latin-lineHeightCompensation); --RS__baseLineHeight:calc(1.5 * var(--RS__lineHeightCompensation)); --RS__selectionTextColor:inherit; diff --git a/css/dist/rtl/ReadiumCSS-default.css b/css/dist/rtl/ReadiumCSS-default.css index 4966054..bf36c46 100644 --- a/css/dist/rtl/ReadiumCSS-default.css +++ b/css/dist/rtl/ReadiumCSS-default.css @@ -1,5 +1,5 @@ /*! - * Readium CSS v.2.0.4 + * Readium CSS v.2.0.5 * Copyright (c) 2017–2026. Readium Foundation. All rights reserved. * Use of this source code is governed by a BSD-style license which is detailed in the * LICENSE file present in the project repository where this source code is maintained. diff --git a/css/dist/webPub/ReadiumCSS-webPub.css b/css/dist/webPub/ReadiumCSS-webPub.css index 15d6cdb..e2cf627 100644 --- a/css/dist/webPub/ReadiumCSS-webPub.css +++ b/css/dist/webPub/ReadiumCSS-webPub.css @@ -1,5 +1,5 @@ /*! - * Readium CSS v.2.0.4 + * Readium CSS v.2.0.5 * Copyright (c) 2017–2026. Readium Foundation. All rights reserved. * Use of this source code is governed by a BSD-style license which is detailed in the * LICENSE file present in the project repository where this source code is maintained. diff --git a/css/src/modules/ReadiumCSS-base.css b/css/src/modules/ReadiumCSS-base.css index 5163c83..bf691e2 100644 --- a/css/src/modules/ReadiumCSS-base.css +++ b/css/src/modules/ReadiumCSS-base.css @@ -23,10 +23,10 @@ @import-json "../../vars/i18n.json"; /* Config */ - --RS__baseFontFamily: var(--RS__default-baseFontFamily); + --RS__baseFontFamily: var(--RS__latin-baseFontFamily); /* For square-ish fonts (CJK, Indic, etc.), we must apply some compensation in leading. Default is 1 i.e. no compensation */ - --RS__lineHeightCompensation: var(--RS__default-lineHeightCompensation); + --RS__lineHeightCompensation: var(--RS__latin-lineHeightCompensation); --RS__baseLineHeight: calc(1.5 * var(--RS__lineHeightCompensation)); /* Default colors (previously implemented as day mode) */ diff --git a/css/vars/CSS-Variables.md b/css/vars/CSS-Variables.md index 23b90c7..07e6e14 100644 --- a/css/vars/CSS-Variables.md +++ b/css/vars/CSS-Variables.md @@ -42,11 +42,11 @@ 1. Find the key matching the publication's full BCP-47 language tag. 2. If no match, strip the region subtag and try again. -3. If no match, use `default` (or ignore, because the line-height compensation should be `1`). +3. If no match, use `latin` (or ignore, because the line-height compensation should be `1`). | Language | Base Font Family | Line Height Compensation | | --- | --- | --- | -| `default` | `var(--RS__oldStyleTf)` | `1` | +| `latin` | `var(--RS__oldStyleTf)` | `1` | | `am` | `Kefa, Nyala, Roboto, Noto, 'Noto Sans Ethiopic', serif` | `1.167` | | `ar` | `'Geeza Pro', 'Arabic Typesetting', Roboto, Noto, 'Noto Naskh Arabic', 'Times New Roman', serif` | — | | `bn` | `'Kohinoor Bangla', 'Bangla Sangam MN', Vrinda, Roboto, Noto, 'Noto Sans Bengali', sans-serif` | `1.067` | @@ -81,7 +81,7 @@ User settings vary by stylesheet variant. Each name below maps to a `--USER__` C | Variant | Disabled | Added | | --- | --- | --- | -| `default` | — | — | +| `ltr` | — | — | | `rtl` | `--USER__bodyHyphens`, `--USER__a11yNormalize`, `--USER__letterSpacing` | — | | `cjk-horizontal` | `--USER__textAlign`, `--USER__bodyHyphens`, `--USER__a11yNormalize`, `--USER__ligatures`, `--USER__paraIndent`, `--USER__wordSpacing` | `--USER__noRuby` | | `cjk-vertical` | `--USER__colCount`, `--USER__textAlign`, `--USER__bodyHyphens`, `--USER__a11yNormalize`, `--USER__ligatures`, `--USER__paraIndent`, `--USER__wordSpacing` | `--USER__noRuby` | diff --git a/css/vars/i18n.json b/css/vars/i18n.json index 5fcadf1..8ca637f 100644 --- a/css/vars/i18n.json +++ b/css/vars/i18n.json @@ -1,5 +1,5 @@ { - "default": { + "latin": { "baseFontFamily": "var(--RS__oldStyleTf)", "lineHeightCompensation": 1 }, diff --git a/css/vars/settings.json b/css/vars/settings.json index ad620eb..d7cae23 100644 --- a/css/vars/settings.json +++ b/css/vars/settings.json @@ -1,5 +1,5 @@ { - "default": { + "ltr": { "disabled": [], "added": [] }, diff --git a/docs/CSS28-migration_guide.md b/docs/CSS28-migration_guide.md index 9fd844c..401eede 100644 --- a/docs/CSS28-migration_guide.md +++ b/docs/CSS28-migration_guide.md @@ -284,7 +284,7 @@ The custom property has been kept so that consumers of ReadiumCSS can still cust ## Exposition of i18n stacks and compensation -As of version `2.0.3`, font-stacks and line-height compensation are exposed for languages e.g. `am`, `ja`, `zh`, etc. so that host apps can import the JSON and consume the data. `default` (Latin) is our reference for all other scripts, and can also be used as a fallback when using the map. +As of version `2.0.5`, font-stacks and line-height compensation are exposed for languages e.g. `am`, `ja`, `zh`, etc. so that host apps can import the JSON and consume the data. `latin` (previously `default` from `2.0.3`) is our reference for all other scripts, and can also be used as a fallback when using the map. A markdown document with tables generated from the JSON files in `vars` has also been added. diff --git a/docs/ReadiumCSS_docs.epub b/docs/ReadiumCSS_docs.epub index 9248b8c..70c0458 100644 Binary files a/docs/ReadiumCSS_docs.epub and b/docs/ReadiumCSS_docs.epub differ diff --git a/docs/ReadiumCSS_docs/OEBPS/Text/Section-028.xhtml b/docs/ReadiumCSS_docs/OEBPS/Text/Section-028.xhtml index 9ee06b5..c45510e 100644 --- a/docs/ReadiumCSS_docs/OEBPS/Text/Section-028.xhtml +++ b/docs/ReadiumCSS_docs/OEBPS/Text/Section-028.xhtml @@ -342,7 +342,7 @@ const backgroundColor = defaultColors.RS__backgroundColor;

Exposition of i18n stacks and compensation

-

As of version 2.0.3, font-stacks and line-height compensation are exposed for languages e.g. am, ja, zh, etc. so that host apps can import the JSON and consume the data. default (Latin) is our reference for all other scripts, and can also be used as a fallback when using the map.

+

As of version 2.0.5, font-stacks and line-height compensation are exposed for languages e.g. am, ja, zh, etc. so that host apps can import the JSON and consume the data. latin (previously default from 2.0.3) is our reference for all other scripts, and can also be used as a fallback when using the map.

A markdown document with tables generated from the JSON files in vars has also been added.

diff --git a/package.json b/package.json index 7f41412..eb3be62 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "@readium/css", "description": "A set of reference stylesheets for EPUB Reading Systems", - "version": "2.0.4", + "version": "2.0.5", "homepage": "https://github.com/readium/css", "license": "BSD-3-Clause", "keywords": [ diff --git a/scripts/generate-vars-doc.js b/scripts/generate-vars-doc.js index 2ebc8d7..e961231 100644 --- a/scripts/generate-vars-doc.js +++ b/scripts/generate-vars-doc.js @@ -26,7 +26,7 @@ const I18N_STRATEGY = `\ 1. Find the key matching the publication's full BCP-47 language tag. 2. If no match, strip the region subtag and try again. -3. If no match, use \`default\` (or ignore, because the line-height compensation should be \`1\`). +3. If no match, use \`latin\` (or ignore, because the line-height compensation should be \`1\`). `;