Skip to content

Commit 5084cac

Browse files
authored
Merge pull request #150 from readium/develop
NPM upgrade + Thorium ports
2 parents 5830114 + 0773e5f commit 5084cac

62 files changed

Lines changed: 6537 additions & 9069 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/node.js.yml

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
# This workflow will do a clean installation of node dependencies, cache/restore them, and build the source code into dist stylesheets. If these are different from the existing ones, it will automatically commit them into the current branch on push and PR events.
2+
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-nodejs
3+
4+
name: Node.js CI
5+
6+
on:
7+
push:
8+
branches: [ "develop" ]
9+
pull_request:
10+
branches: [ "develop" ]
11+
12+
jobs:
13+
build:
14+
15+
runs-on: ubuntu-latest
16+
permissions:
17+
contents: write
18+
19+
steps:
20+
- uses: actions/checkout@v4
21+
with:
22+
ref: ${{ github.head_ref }}
23+
- name: Use Node.js
24+
uses: actions/setup-node@v4
25+
with:
26+
node-version: '20.x'
27+
cache: 'npm'
28+
- run: npm ci
29+
- run: npm run build --if-present
30+
- uses: stefanzweifel/git-auto-commit-action@v5
31+
with:
32+
file_pattern: "css/dist/**"
33+
commit_message: Update dist

README.md

Lines changed: 40 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,8 @@ Readium CSS provides styles for reflowable text:
1212
- reading modes (day, night, and sepia);
1313
- themes;
1414
- user settings;
15-
- media overlays and user highlights;
1615
- a set of baselines and recommendations for accessibility, overrides, and internationalization.
1716

18-
**Readium CSS is currently in alpha** (version `1.0.0-beta.1`).
19-
2017
## License
2118

2219
BSD-3-Clause (http://opensource.org/licenses/BSD-3-Clause)
@@ -47,6 +44,46 @@ There is no external implementation of Readium CSS so far.
4744

4845
Consequently, if you are encountering rendering issues with Readium (iOS apps, Android apps, or the Readium Chrome App), please report them on the [github section dedicated to the proper Readium project](https://github.com/readium) (readium-js, readium-shared-js, readium-sdk, etc.).
4946

47+
## Development
48+
49+
Active development is pulled in branch `develop` first, and then made available in the main branch when sufficiently tested and deemed stable.
50+
51+
### Init
52+
53+
Building and testing are relying on npm packages and scripts. To initialize your clone/fork, first install dev dependencies:
54+
55+
```
56+
npm install
57+
```
58+
59+
In case you’re encountering an error with Puppeteer, make sure you’re using at least Node v.20.11.1 – it might work with an earlier version but only the latest LTS as of March 21, 2024 has been tested.
60+
61+
Then create reference bitmaps for visual regression testing:
62+
63+
```
64+
npm run test:ref
65+
```
66+
67+
### Build
68+
69+
To transpile all stylesheets using PostCSS:
70+
71+
```
72+
npm run build
73+
```
74+
75+
To test the updated styles and catch visual regression bugs:
76+
77+
```
78+
npm run test
79+
```
80+
81+
To update reference bitmaps after a bugfix:
82+
83+
```
84+
npm run test:approve
85+
```
86+
5087
## Docs
5188

5289
Documentation [can be accessed in docs](docs).

backstop.json

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -160,6 +160,13 @@
160160
"selectors": ["document"],
161161
"misMatchThreshold" : 0.1
162162
},
163+
{
164+
"label": "Letterspacing CJK pref",
165+
"url": "http://localhost:8000/tests/letter-spacing-cjk.html",
166+
"delay": 0,
167+
"selectors": ["document"],
168+
"misMatchThreshold" : 0.1
169+
},
163170
{
164171
"label": "Ligatures pref",
165172
"url": "http://localhost:8000/tests/arabic-ligatures.html",
@@ -170,7 +177,7 @@
170177
{
171178
"label": "Accessibility font pref",
172179
"url": "http://localhost:8000/tests/a11y-font.html",
173-
"delay": 0,
180+
"delay": 200,
174181
"selectors": ["document"],
175182
"misMatchThreshold" : 0.1
176183
},
@@ -184,6 +191,13 @@
184191
{
185192
"label": "Accessibility custom pref",
186193
"url": "http://localhost:8000/tests/a11y-custom.html",
194+
"delay": 200,
195+
"selectors": ["document"],
196+
"misMatchThreshold" : 0.1
197+
},
198+
{
199+
"label": "no Ruby pref",
200+
"url": "http://localhost:8000/tests/no-ruby.html",
187201
"delay": 0,
188202
"selectors": ["document"],
189203
"misMatchThreshold" : 0.1

css/ReadMe.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,7 @@ Readium CSS is a set of reference stylesheets for EPUB Reading Systems. It provi
77
- default styles;
88
- reading modes (night, sepia, etc.);
99
- themes;
10-
- user settings;
11-
- media overlays and user highlights.
10+
- user settings.
1211

1312
**Note:** Readium CSS stylesheets were not designed and should not be used for fixed-layout EPUB, nor other file formats like FB2, PRC, Mobi, TEI, etc.
1413

css/ReadiumCSS-config.css

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,9 @@
4444
@custom-selector :--darken-filter [style*="readium-darken-on"];
4545
@custom-selector :--invert-filter [style*="readium-invert-on"];
4646

47+
/* Hiding ruby */
48+
@custom-selector :--no-ruby [style*="readium-noRuby-on"];
49+
4750
/* Accessibility normalization */
4851
@custom-selector :--a11y-normalize [style*="readium-a11y-on"];
4952

css/dist/ReadMe.md

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -54,8 +54,11 @@ Disabled user settings:
5454
- `text-align`;
5555
- `hyphens`;
5656
- paragraphs’ indent;
57-
- `word-spacing`;
58-
- `letter-spacing`.
57+
- `word-spacing`.
58+
59+
Added user settings:
60+
61+
- hiding/disabling ruby (mapped to `--USER__noRuby: readium-noRuby-on` flag).
5962

6063
### Vertical
6164

@@ -87,8 +90,11 @@ Disabled user settings:
8790
- `text-align`;
8891
- `hyphens`;
8992
- paragraphs’ indent;
90-
- `word-spacing`;
91-
- `letter-spacing`.
93+
- `word-spacing`.
94+
95+
Added user settings:
96+
97+
- hiding/disabling ruby (mapped to `--USER__noRuby: readium-noRuby-on` flag).
9298

9399
### EBPAJ Polyfill
94100

0 commit comments

Comments
 (0)