Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .github/workflows/playwright.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion css/dist/ReadiumCSS-after.css
Original file line number Diff line number Diff line change
@@ -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.
Expand Down
10 changes: 5 additions & 5 deletions css/dist/ReadiumCSS-before.css
Original file line number Diff line number Diff line change
@@ -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.
Expand Down Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion css/dist/ReadiumCSS-default.css
Original file line number Diff line number Diff line change
@@ -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.
Expand Down
2 changes: 1 addition & 1 deletion css/dist/cjk-horizontal/ReadiumCSS-after.css
Original file line number Diff line number Diff line change
@@ -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.
Expand Down
10 changes: 5 additions & 5 deletions css/dist/cjk-horizontal/ReadiumCSS-before.css
Original file line number Diff line number Diff line change
@@ -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.
Expand Down Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion css/dist/cjk-horizontal/ReadiumCSS-default.css
Original file line number Diff line number Diff line change
@@ -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.
Expand Down
2 changes: 1 addition & 1 deletion css/dist/cjk-vertical/ReadiumCSS-after.css
Original file line number Diff line number Diff line change
@@ -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.
Expand Down
10 changes: 5 additions & 5 deletions css/dist/cjk-vertical/ReadiumCSS-before.css
Original file line number Diff line number Diff line change
@@ -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.
Expand Down Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion css/dist/cjk-vertical/ReadiumCSS-default.css
Original file line number Diff line number Diff line change
@@ -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.
Expand Down
2 changes: 1 addition & 1 deletion css/dist/rtl/ReadiumCSS-after.css
Original file line number Diff line number Diff line change
@@ -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.
Expand Down
10 changes: 5 additions & 5 deletions css/dist/rtl/ReadiumCSS-before.css
Original file line number Diff line number Diff line change
@@ -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.
Expand Down Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion css/dist/rtl/ReadiumCSS-default.css
Original file line number Diff line number Diff line change
@@ -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.
Expand Down
2 changes: 1 addition & 1 deletion css/dist/webPub/ReadiumCSS-webPub.css
Original file line number Diff line number Diff line change
@@ -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.
Expand Down
4 changes: 2 additions & 2 deletions css/src/modules/ReadiumCSS-base.css
Original file line number Diff line number Diff line change
Expand Up @@ -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) */
Expand Down
6 changes: 3 additions & 3 deletions css/vars/CSS-Variables.md
Original file line number Diff line number Diff line change
Expand Up @@ -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` |
Expand Down Expand Up @@ -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` |
Expand Down
2 changes: 1 addition & 1 deletion css/vars/i18n.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"default": {
"latin": {
"baseFontFamily": "var(--RS__oldStyleTf)",
"lineHeightCompensation": 1
},
Expand Down
2 changes: 1 addition & 1 deletion css/vars/settings.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"default": {
"ltr": {
"disabled": [],
"added": []
},
Expand Down
2 changes: 1 addition & 1 deletion docs/CSS28-migration_guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand Down
Binary file modified docs/ReadiumCSS_docs.epub
Binary file not shown.
2 changes: 1 addition & 1 deletion docs/ReadiumCSS_docs/OEBPS/Text/Section-028.xhtml
Original file line number Diff line number Diff line change
Expand Up @@ -342,7 +342,7 @@ const backgroundColor = defaultColors.RS__backgroundColor;</code></pre>
<section id="i18n-stacks-exposition" class="level2">
<h2 id="sigil_toc_id_226">Exposition of i18n stacks and compensation</h2>

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

<p>A markdown document with tables generated from the JSON files in <code>vars</code> has also been added.</p>
</section>
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -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": [
Expand Down
2 changes: 1 addition & 1 deletion scripts/generate-vars-doc.js
Original file line number Diff line number Diff line change
Expand Up @@ -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\`).
`;

Expand Down
Loading