Skip to content

Commit

Permalink
Fix pagination in Safari
Browse files Browse the repository at this point in the history
Resolves #154 by reverting commit #5680018
  • Loading branch information
JayPanoz committed Nov 5, 2024
1 parent 7951735 commit 0060fe4
Show file tree
Hide file tree
Showing 21 changed files with 54 additions and 25 deletions.
11 changes: 9 additions & 2 deletions css/dist/ReadiumCSS-after.css
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Readium CSS (v. 2.0.0-alpha.2)
* Readium CSS (v. 2.0.0-alpha.3)
* Developers: Jiminy Panoz
* Copyright (c) 2017. Readium Foundation. All rights reserved.
* Use of this source code is governed by a BSD-style license which is detailed in the
Expand All @@ -15,7 +15,7 @@
@namespace svg url("http://www.w3.org/2000/svg");

:root{
--RS__colWidth:auto;
--RS__colWidth:100vw;
--RS__colCount:1;
--RS__colGap:0;
--RS__defaultLineLength:40rem;
Expand Down Expand Up @@ -273,6 +273,13 @@ body{
column-count:1;
}

:root[style*="--USER__colCount: 0"],
:root[style*="--USER__colCount:0"],
:root[style*="--USER__colCount: 1"],
:root[style*="--USER__colCount:1"]{
--RS__colWidth:100vw;
}

:root[style*="--USER__lineLength"] body{
max-width:var(--USER__lineLength) !important;
}
Expand Down
2 changes: 1 addition & 1 deletion css/dist/ReadiumCSS-before.css
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Readium CSS (v. 2.0.0-alpha.2)
* Readium CSS (v. 2.0.0-alpha.3)
* Developers: Jiminy Panoz
* Copyright (c) 2017. Readium Foundation. All rights reserved.
* Use of this source code is governed by a BSD-style license which is detailed in the
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.0-alpha.2)
* Readium CSS (v. 2.0.0-alpha.3)
* Developers: Jiminy Panoz
* Copyright (c) 2017. Readium Foundation. All rights reserved.
* Use of this source code is governed by a BSD-style license which is detailed in the
Expand Down
11 changes: 9 additions & 2 deletions 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.0-alpha.2)
* Readium CSS (v. 2.0.0-alpha.3)
* Developers: Jiminy Panoz
* Copyright (c) 2017. Readium Foundation. All rights reserved.
* Use of this source code is governed by a BSD-style license which is detailed in the
Expand All @@ -15,7 +15,7 @@
@namespace svg url("http://www.w3.org/2000/svg");

:root{
--RS__colWidth:auto;
--RS__colWidth:100vw;
--RS__colCount:1;
--RS__colGap:0;
--RS__defaultLineLength:40rem;
Expand Down Expand Up @@ -273,6 +273,13 @@ body{
column-count:1;
}

:root[style*="--USER__colCount: 0"],
:root[style*="--USER__colCount:0"],
:root[style*="--USER__colCount: 1"],
:root[style*="--USER__colCount:1"]{
--RS__colWidth:100vw;
}

:root[style*="--USER__lineLength"] body{
max-width:var(--USER__lineLength) !important;
}
Expand Down
2 changes: 1 addition & 1 deletion 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.0-alpha.2)
* Readium CSS (v. 2.0.0-alpha.3)
* Developers: Jiminy Panoz
* Copyright (c) 2017. Readium Foundation. All rights reserved.
* Use of this source code is governed by a BSD-style license which is detailed in the
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.0-alpha.2)
* Readium CSS (v. 2.0.0-alpha.3)
* Developers: Jiminy Panoz
* Copyright (c) 2017. Readium Foundation. All rights reserved.
* Use of this source code is governed by a BSD-style license which is detailed in the
Expand Down
4 changes: 2 additions & 2 deletions 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.0-alpha.2)
* Readium CSS (v. 2.0.0-alpha.3)
* Developers: Jiminy Panoz
* Copyright (c) 2017. Readium Foundation. All rights reserved.
* Use of this source code is governed by a BSD-style license which is detailed in the
Expand All @@ -15,7 +15,7 @@
@namespace svg url("http://www.w3.org/2000/svg");

:root{
--RS__colWidth:auto;
--RS__colWidth:100vh;
--RS__colCount:1;
--RS__colGap:0;
--RS__defaultLineLength:40rem;
Expand Down
2 changes: 1 addition & 1 deletion 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.0-alpha.2)
* Readium CSS (v. 2.0.0-alpha.3)
* Developers: Jiminy Panoz
* Copyright (c) 2017. Readium Foundation. All rights reserved.
* Use of this source code is governed by a BSD-style license which is detailed in the
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.0-alpha.2)
* Readium CSS (v. 2.0.0-alpha.3)
* Developers: Jiminy Panoz
* Copyright (c) 2017. Readium Foundation. All rights reserved.
* Use of this source code is governed by a BSD-style license which is detailed in the
Expand Down
11 changes: 9 additions & 2 deletions 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.0-alpha.2)
* Readium CSS (v. 2.0.0-alpha.3)
* Developers: Jiminy Panoz
* Copyright (c) 2017. Readium Foundation. All rights reserved.
* Use of this source code is governed by a BSD-style license which is detailed in the
Expand All @@ -15,7 +15,7 @@
@namespace svg url("http://www.w3.org/2000/svg");

:root{
--RS__colWidth:auto;
--RS__colWidth:100vw;
--RS__colCount:1;
--RS__colGap:0;
--RS__defaultLineLength:40rem;
Expand Down Expand Up @@ -273,6 +273,13 @@ body{
column-count:1;
}

:root[style*="--USER__colCount: 0"],
:root[style*="--USER__colCount:0"],
:root[style*="--USER__colCount: 1"],
:root[style*="--USER__colCount:1"]{
--RS__colWidth:100vw;
}

:root[style*="--USER__lineLength"] body{
max-width:var(--USER__lineLength) !important;
}
Expand Down
2 changes: 1 addition & 1 deletion 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.0-alpha.2)
* Readium CSS (v. 2.0.0-alpha.3)
* Developers: Jiminy Panoz
* Copyright (c) 2017. Readium Foundation. All rights reserved.
* Use of this source code is governed by a BSD-style license which is detailed in the
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.0-alpha.2)
* Readium CSS (v. 2.0.0-alpha.3)
* Developers: Jiminy Panoz
* Copyright (c) 2017. Readium Foundation. All rights reserved.
* Use of this source code is governed by a BSD-style license which is detailed in the
Expand Down
4 changes: 2 additions & 2 deletions css/src/modules/ReadiumCSS-pagination-vertical.css
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@

/* Default for smartphone portrait (small screens) */
:root {
/* The column algorithm will prioritize column-count */
--RS__colWidth: auto;
/* We need to set this for Safari as it won’t take auto for a single-col */
--RS__colWidth: 100vh;

/* Since columns are laid out on the y-axis in vertical-*, we can only use 1 */
--RS__colCount: 1;
Expand Down
4 changes: 2 additions & 2 deletions css/src/modules/ReadiumCSS-pagination.css
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@

/* Default for smartphone portrait (small screens) */
:root {
/* The column algorithm will prioritize column-count */
--RS__colWidth: auto;
/* We need to set this for Safari as it won’t take auto for a single-col */
--RS__colWidth: 100vw;

/* Ideal number of columns (depending on columns’ width floor) */
--RS__colCount: 1;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,12 @@
-webkit-column-count: 1;
-moz-column-count: 1;
column-count: 1;
}

/* If one column, make sure we reset colWidth for Safari. There is no colNumber setting in vertical writing so we don’t need to address vw/vh */
:root[style*="--USER__colCount: 0"],
:root[style*="--USER__colCount:0"],
:root[style*="--USER__colCount: 1"],
:root[style*="--USER__colCount:1"] {
--RS__colWidth: 100vw;
}
2 changes: 1 addition & 1 deletion docs/CSS03-injection_and_pagination.md
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ Please note those variables’ value can be redefined using media queries. You d
--RS__colWidth
```

The optimal column’s width. We set it to `auto` so that the column-count can be prioritized.
The optimal column’s width. We set it to `100%` (`100vh` in vertical-writing) for a single-column for Safari – otherwise it won’t fragment content, and `auto` for multiple so that the column-count can be prioritized.

* * *

Expand Down
2 changes: 1 addition & 1 deletion docs/CSS19-api.md
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ Custom properties for the Reading System are prefixed with `--RS__`.
--RS__colWidth
```

The optimal column’s width. We set it to `auto` so that the column-count can be prioritized
The optimal column’s width. We set it to `100vw` (`100vh` in vertical-writing) for a single-column for Safari – otherwise it won’t fragment content, and `auto` for multiple so that the column-count can be prioritized.

* * *

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-003.xhtml
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@

<pre><code>--RS__colWidth</code></pre>

<p>The optimal column’s width. We set it to <code>auto</code> so that the column-count can be prioritized</p>
<p>The optimal column’s width. We set it to <code>100vw</code> (<code>100vh</code> in vertical writing) for a single-column for Safari – otherwise it won’t fragment content, and <code>auto</code> for multiple so that the column-count can be prioritized.</p>

<hr/>

Expand Down
2 changes: 1 addition & 1 deletion docs/ReadiumCSS_docs/OEBPS/Text/Section-019.xhtml
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@

<pre><code>--RS__colWidth</code></pre>

<p>The optimal column’s width. We set it to <code>auto</code> so that the column-count can be prioritized</p>
<p>The optimal column’s width. We set it to <code>100%</code> (<code>100vh</code> in vertical writing) for a single-column for Safari – otherwise it won’t fragment content, and <code>auto</code> for multiple so that the column-count can be prioritized.</p>

<hr/>

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.0-alpha.2",
"version": "2.0.0-alpha.3",
"homepage": "https://github.com/readium/readium-css",
"license": "BSD-3-Clause",
"keywords": [
Expand Down

0 comments on commit 0060fe4

Please sign in to comment.