Skip to content

Beta 11 #173

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 8 commits into from
Apr 14, 2025
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
Prev Previous commit
Next Next commit
Init ipadOS patch
  • Loading branch information
JayPanoz committed Apr 14, 2025
commit e52635886d629d484c3e37c5a9770a1ce1eda516
5 changes: 4 additions & 1 deletion css/ReadiumCSS-config.css
Original file line number Diff line number Diff line change
Expand Up @@ -45,4 +45,7 @@

/* Direction i.e. ltr and rtl */
@custom-selector :--ltr [dir="ltr"];
@custom-selector :--rtl [dir="rtl"];
@custom-selector :--rtl [dir="rtl"];

/* Patch for iPadOS */
@custom-selector :--ipadOS-patch [style*="readium-iPadOSPatch-on"];
59 changes: 59 additions & 0 deletions css/dist/ReadiumCSS-after.css
Original file line number Diff line number Diff line change
Expand Up @@ -591,4 +591,63 @@ body{
:root[style*="readium-normalize-on"][style*="--USER__typeScale"] h3{
font-size:calc(1rem * var(--USER__typeScale)) !important;
}
}

:root[style*="readium-iPadOSPatch-on"] body{
-webkit-text-size-adjust:none;
}

:root[style*="readium-iPadOSPatch-on"] p,
:root[style*="readium-iPadOSPatch-on"] h1,
:root[style*="readium-iPadOSPatch-on"] h2,
:root[style*="readium-iPadOSPatch-on"] h3,
:root[style*="readium-iPadOSPatch-on"] h4,
:root[style*="readium-iPadOSPatch-on"] h5,
:root[style*="readium-iPadOSPatch-on"] h6,
:root[style*="readium-iPadOSPatch-on"] li,
:root[style*="readium-iPadOSPatch-on"] th,
:root[style*="readium-iPadOSPatch-on"] td,
:root[style*="readium-iPadOSPatch-on"] dt,
:root[style*="readium-iPadOSPatch-on"] dd,
:root[style*="readium-iPadOSPatch-on"] pre,
:root[style*="readium-iPadOSPatch-on"] address,
:root[style*="readium-iPadOSPatch-on"] details,
:root[style*="readium-iPadOSPatch-on"] summary,
:root[style*="readium-iPadOSPatch-on"] figcaption,
:root[style*="readium-iPadOSPatch-on"] div:not(:has(p, h1, h2, h3, h4, h5, h6, li, th, td, dt, dd, pre, address, aside, details, figcaption, summary)),
:root[style*="readium-iPadOSPatch-on"] aside:not(:has(p, h1, h2, h3, h4, h5, h6, li, th, td, dt, dd, pre, address, aside, details, figcaption, summary)){
-webkit-text-zoom:reset;
}

:root[style*="readium-iPadOSPatch-on"] abbr,
:root[style*="readium-iPadOSPatch-on"] b,
:root[style*="readium-iPadOSPatch-on"] bdi,
:root[style*="readium-iPadOSPatch-on"] bdo,
:root[style*="readium-iPadOSPatch-on"] cite,
:root[style*="readium-iPadOSPatch-on"] code,
:root[style*="readium-iPadOSPatch-on"] dfn,
:root[style*="readium-iPadOSPatch-on"] em,
:root[style*="readium-iPadOSPatch-on"] i,
:root[style*="readium-iPadOSPatch-on"] kbd,
:root[style*="readium-iPadOSPatch-on"] mark,
:root[style*="readium-iPadOSPatch-on"] q,
:root[style*="readium-iPadOSPatch-on"] rp,
:root[style*="readium-iPadOSPatch-on"] rt,
:root[style*="readium-iPadOSPatch-on"] ruby,
:root[style*="readium-iPadOSPatch-on"] s,
:root[style*="readium-iPadOSPatch-on"] samp,
:root[style*="readium-iPadOSPatch-on"] small,
:root[style*="readium-iPadOSPatch-on"] span,
:root[style*="readium-iPadOSPatch-on"] strong,
:root[style*="readium-iPadOSPatch-on"] sub,
:root[style*="readium-iPadOSPatch-on"] sup,
:root[style*="readium-iPadOSPatch-on"] time,
:root[style*="readium-iPadOSPatch-on"] u,
:root[style*="readium-iPadOSPatch-on"] var{
-webkit-text-zoom:normal;
}

:root[style*="readium-iPadOSPatch-on"] *:first-line,
:root[style*="readium-iPadOSPatch-on"] *:first-letter{
-webkit-text-zoom:normal;
}
59 changes: 59 additions & 0 deletions css/dist/cjk-horizontal/ReadiumCSS-after.css
Original file line number Diff line number Diff line change
Expand Up @@ -501,4 +501,63 @@ body{
:root[style*="readium-normalize-on"][style*="--USER__typeScale"] h3{
font-size:calc(1rem * var(--USER__typeScale)) !important;
}
}

:root[style*="readium-iPadOSPatch-on"] body{
-webkit-text-size-adjust:none;
}

:root[style*="readium-iPadOSPatch-on"] p,
:root[style*="readium-iPadOSPatch-on"] h1,
:root[style*="readium-iPadOSPatch-on"] h2,
:root[style*="readium-iPadOSPatch-on"] h3,
:root[style*="readium-iPadOSPatch-on"] h4,
:root[style*="readium-iPadOSPatch-on"] h5,
:root[style*="readium-iPadOSPatch-on"] h6,
:root[style*="readium-iPadOSPatch-on"] li,
:root[style*="readium-iPadOSPatch-on"] th,
:root[style*="readium-iPadOSPatch-on"] td,
:root[style*="readium-iPadOSPatch-on"] dt,
:root[style*="readium-iPadOSPatch-on"] dd,
:root[style*="readium-iPadOSPatch-on"] pre,
:root[style*="readium-iPadOSPatch-on"] address,
:root[style*="readium-iPadOSPatch-on"] details,
:root[style*="readium-iPadOSPatch-on"] summary,
:root[style*="readium-iPadOSPatch-on"] figcaption,
:root[style*="readium-iPadOSPatch-on"] div:not(:has(p, h1, h2, h3, h4, h5, h6, li, th, td, dt, dd, pre, address, aside, details, figcaption, summary)),
:root[style*="readium-iPadOSPatch-on"] aside:not(:has(p, h1, h2, h3, h4, h5, h6, li, th, td, dt, dd, pre, address, aside, details, figcaption, summary)){
-webkit-text-zoom:reset;
}

:root[style*="readium-iPadOSPatch-on"] abbr,
:root[style*="readium-iPadOSPatch-on"] b,
:root[style*="readium-iPadOSPatch-on"] bdi,
:root[style*="readium-iPadOSPatch-on"] bdo,
:root[style*="readium-iPadOSPatch-on"] cite,
:root[style*="readium-iPadOSPatch-on"] code,
:root[style*="readium-iPadOSPatch-on"] dfn,
:root[style*="readium-iPadOSPatch-on"] em,
:root[style*="readium-iPadOSPatch-on"] i,
:root[style*="readium-iPadOSPatch-on"] kbd,
:root[style*="readium-iPadOSPatch-on"] mark,
:root[style*="readium-iPadOSPatch-on"] q,
:root[style*="readium-iPadOSPatch-on"] rp,
:root[style*="readium-iPadOSPatch-on"] rt,
:root[style*="readium-iPadOSPatch-on"] ruby,
:root[style*="readium-iPadOSPatch-on"] s,
:root[style*="readium-iPadOSPatch-on"] samp,
:root[style*="readium-iPadOSPatch-on"] small,
:root[style*="readium-iPadOSPatch-on"] span,
:root[style*="readium-iPadOSPatch-on"] strong,
:root[style*="readium-iPadOSPatch-on"] sub,
:root[style*="readium-iPadOSPatch-on"] sup,
:root[style*="readium-iPadOSPatch-on"] time,
:root[style*="readium-iPadOSPatch-on"] u,
:root[style*="readium-iPadOSPatch-on"] var{
-webkit-text-zoom:normal;
}

:root[style*="readium-iPadOSPatch-on"] *:first-line,
:root[style*="readium-iPadOSPatch-on"] *:first-letter{
-webkit-text-zoom:normal;
}
59 changes: 59 additions & 0 deletions css/dist/cjk-vertical/ReadiumCSS-after.css
Original file line number Diff line number Diff line change
Expand Up @@ -489,4 +489,63 @@ body{
:root[style*="readium-normalize-on"][style*="--USER__typeScale"] h3{
font-size:calc(1rem * var(--USER__typeScale)) !important;
}
}

:root[style*="readium-iPadOSPatch-on"] body{
-webkit-text-size-adjust:none;
}

:root[style*="readium-iPadOSPatch-on"] p,
:root[style*="readium-iPadOSPatch-on"] h1,
:root[style*="readium-iPadOSPatch-on"] h2,
:root[style*="readium-iPadOSPatch-on"] h3,
:root[style*="readium-iPadOSPatch-on"] h4,
:root[style*="readium-iPadOSPatch-on"] h5,
:root[style*="readium-iPadOSPatch-on"] h6,
:root[style*="readium-iPadOSPatch-on"] li,
:root[style*="readium-iPadOSPatch-on"] th,
:root[style*="readium-iPadOSPatch-on"] td,
:root[style*="readium-iPadOSPatch-on"] dt,
:root[style*="readium-iPadOSPatch-on"] dd,
:root[style*="readium-iPadOSPatch-on"] pre,
:root[style*="readium-iPadOSPatch-on"] address,
:root[style*="readium-iPadOSPatch-on"] details,
:root[style*="readium-iPadOSPatch-on"] summary,
:root[style*="readium-iPadOSPatch-on"] figcaption,
:root[style*="readium-iPadOSPatch-on"] div:not(:has(p, h1, h2, h3, h4, h5, h6, li, th, td, dt, dd, pre, address, aside, details, figcaption, summary)),
:root[style*="readium-iPadOSPatch-on"] aside:not(:has(p, h1, h2, h3, h4, h5, h6, li, th, td, dt, dd, pre, address, aside, details, figcaption, summary)){
-webkit-text-zoom:reset;
}

:root[style*="readium-iPadOSPatch-on"] abbr,
:root[style*="readium-iPadOSPatch-on"] b,
:root[style*="readium-iPadOSPatch-on"] bdi,
:root[style*="readium-iPadOSPatch-on"] bdo,
:root[style*="readium-iPadOSPatch-on"] cite,
:root[style*="readium-iPadOSPatch-on"] code,
:root[style*="readium-iPadOSPatch-on"] dfn,
:root[style*="readium-iPadOSPatch-on"] em,
:root[style*="readium-iPadOSPatch-on"] i,
:root[style*="readium-iPadOSPatch-on"] kbd,
:root[style*="readium-iPadOSPatch-on"] mark,
:root[style*="readium-iPadOSPatch-on"] q,
:root[style*="readium-iPadOSPatch-on"] rp,
:root[style*="readium-iPadOSPatch-on"] rt,
:root[style*="readium-iPadOSPatch-on"] ruby,
:root[style*="readium-iPadOSPatch-on"] s,
:root[style*="readium-iPadOSPatch-on"] samp,
:root[style*="readium-iPadOSPatch-on"] small,
:root[style*="readium-iPadOSPatch-on"] span,
:root[style*="readium-iPadOSPatch-on"] strong,
:root[style*="readium-iPadOSPatch-on"] sub,
:root[style*="readium-iPadOSPatch-on"] sup,
:root[style*="readium-iPadOSPatch-on"] time,
:root[style*="readium-iPadOSPatch-on"] u,
:root[style*="readium-iPadOSPatch-on"] var{
-webkit-text-zoom:normal;
}

:root[style*="readium-iPadOSPatch-on"] *:first-line,
:root[style*="readium-iPadOSPatch-on"] *:first-letter{
-webkit-text-zoom:normal;
}
59 changes: 59 additions & 0 deletions css/dist/rtl/ReadiumCSS-after.css
Original file line number Diff line number Diff line change
Expand Up @@ -526,4 +526,63 @@ body{
:root[style*="readium-normalize-on"][style*="--USER__typeScale"] h3{
font-size:calc(1rem * var(--USER__typeScale)) !important;
}
}

:root[style*="readium-iPadOSPatch-on"] body{
-webkit-text-size-adjust:none;
}

:root[style*="readium-iPadOSPatch-on"] p,
:root[style*="readium-iPadOSPatch-on"] h1,
:root[style*="readium-iPadOSPatch-on"] h2,
:root[style*="readium-iPadOSPatch-on"] h3,
:root[style*="readium-iPadOSPatch-on"] h4,
:root[style*="readium-iPadOSPatch-on"] h5,
:root[style*="readium-iPadOSPatch-on"] h6,
:root[style*="readium-iPadOSPatch-on"] li,
:root[style*="readium-iPadOSPatch-on"] th,
:root[style*="readium-iPadOSPatch-on"] td,
:root[style*="readium-iPadOSPatch-on"] dt,
:root[style*="readium-iPadOSPatch-on"] dd,
:root[style*="readium-iPadOSPatch-on"] pre,
:root[style*="readium-iPadOSPatch-on"] address,
:root[style*="readium-iPadOSPatch-on"] details,
:root[style*="readium-iPadOSPatch-on"] summary,
:root[style*="readium-iPadOSPatch-on"] figcaption,
:root[style*="readium-iPadOSPatch-on"] div:not(:has(p, h1, h2, h3, h4, h5, h6, li, th, td, dt, dd, pre, address, aside, details, figcaption, summary)),
:root[style*="readium-iPadOSPatch-on"] aside:not(:has(p, h1, h2, h3, h4, h5, h6, li, th, td, dt, dd, pre, address, aside, details, figcaption, summary)){
-webkit-text-zoom:reset;
}

:root[style*="readium-iPadOSPatch-on"] abbr,
:root[style*="readium-iPadOSPatch-on"] b,
:root[style*="readium-iPadOSPatch-on"] bdi,
:root[style*="readium-iPadOSPatch-on"] bdo,
:root[style*="readium-iPadOSPatch-on"] cite,
:root[style*="readium-iPadOSPatch-on"] code,
:root[style*="readium-iPadOSPatch-on"] dfn,
:root[style*="readium-iPadOSPatch-on"] em,
:root[style*="readium-iPadOSPatch-on"] i,
:root[style*="readium-iPadOSPatch-on"] kbd,
:root[style*="readium-iPadOSPatch-on"] mark,
:root[style*="readium-iPadOSPatch-on"] q,
:root[style*="readium-iPadOSPatch-on"] rp,
:root[style*="readium-iPadOSPatch-on"] rt,
:root[style*="readium-iPadOSPatch-on"] ruby,
:root[style*="readium-iPadOSPatch-on"] s,
:root[style*="readium-iPadOSPatch-on"] samp,
:root[style*="readium-iPadOSPatch-on"] small,
:root[style*="readium-iPadOSPatch-on"] span,
:root[style*="readium-iPadOSPatch-on"] strong,
:root[style*="readium-iPadOSPatch-on"] sub,
:root[style*="readium-iPadOSPatch-on"] sup,
:root[style*="readium-iPadOSPatch-on"] time,
:root[style*="readium-iPadOSPatch-on"] u,
:root[style*="readium-iPadOSPatch-on"] var{
-webkit-text-zoom:normal;
}

:root[style*="readium-iPadOSPatch-on"] *:first-line,
:root[style*="readium-iPadOSPatch-on"] *:first-letter{
-webkit-text-zoom:normal;
}
3 changes: 2 additions & 1 deletion css/src/ReadiumCSS-after-cjk-horizontal.css
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,5 @@
@import "modules/user-settings-submodules/ReadiumCSS-letterSpacing_pref.css";
@import "modules/user-settings-submodules/ReadiumCSS-ruby_pref.css";
@import "modules/user-settings-submodules/ReadiumCSS-imageFilters_pref.css";
@import "modules/ReadiumCSS-fs_normalize.css";
@import "modules/ReadiumCSS-fs_normalize.css";
@import "modules/ReadiumCSS-iPadOS_patch.css";
3 changes: 2 additions & 1 deletion css/src/ReadiumCSS-after-cjk-vertical.css
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,5 @@
@import "modules/user-settings-submodules/ReadiumCSS-letterSpacing_pref.css";
@import "modules/user-settings-submodules/ReadiumCSS-ruby_pref.css";
@import "modules/user-settings-submodules/ReadiumCSS-imageFilters_pref.css";
@import "modules/ReadiumCSS-fs_normalize.css";
@import "modules/ReadiumCSS-fs_normalize.css";
@import "modules/ReadiumCSS-iPadOS_patch.css";
3 changes: 2 additions & 1 deletion css/src/ReadiumCSS-after-rtl.css
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,5 @@
@import "modules/user-settings-submodules/ReadiumCSS-arabicLigatures_pref.css";
@import "modules/user-settings-submodules/ReadiumCSS-variableFont_pref.css";
@import "modules/user-settings-submodules/ReadiumCSS-imageFilters_pref.css";
@import "modules/ReadiumCSS-fs_normalize.css";
@import "modules/ReadiumCSS-fs_normalize.css";
@import "modules/ReadiumCSS-iPadOS_patch.css";
3 changes: 2 additions & 1 deletion css/src/ReadiumCSS-after.css
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,5 @@
@import "modules/user-settings-submodules/ReadiumCSS-letterSpacing_pref.css";
@import "modules/user-settings-submodules/ReadiumCSS-variableFont_pref.css";
@import "modules/user-settings-submodules/ReadiumCSS-imageFilters_pref.css";
@import "modules/ReadiumCSS-fs_normalize.css";
@import "modules/ReadiumCSS-fs_normalize.css";
@import "modules/ReadiumCSS-iPadOS_patch.css";
80 changes: 80 additions & 0 deletions css/src/modules/ReadiumCSS-iPadOS_patch.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
/* Readium CSS
iPadOS + desktop website Patch stylesheet

A set of style to get around iPadOS specific issues with zoom.
This has to be applied when the desktop version is requested by iPadOS
When the user requests the mobile version it is entirely fine and should
not be used

See https://github.com/readium/readium-css/issues/172

Repo: https://github.com/readium/readium-css */

/* Disable iPadOS + desktop zoom intervention */

:root:--ipadOS-patch body {
-webkit-text-size-adjust: none;
}

/* There is nothing we can use in CSS to alternate the values so this will be high maintenance */

/* Sanitize flow/block elements, we have to reset them */

:root:--ipadOS-patch p,
:root:--ipadOS-patch h1,
:root:--ipadOS-patch h2,
:root:--ipadOS-patch h3,
:root:--ipadOS-patch h4,
:root:--ipadOS-patch h5,
:root:--ipadOS-patch h6,
:root:--ipadOS-patch li,
:root:--ipadOS-patch th,
:root:--ipadOS-patch td,
:root:--ipadOS-patch dt,
:root:--ipadOS-patch dd,
:root:--ipadOS-patch pre,
:root:--ipadOS-patch address,
:root:--ipadOS-patch details,
:root:--ipadOS-patch summary,
:root:--ipadOS-patch figcaption,
:root:--ipadOS-patch div:not(:has(p, h1, h2, h3, h4, h5, h6, li, th, td, dt, dd, pre, address, aside, details, figcaption, summary)),
:root:--ipadOS-patch aside:not(:has(p, h1, h2, h3, h4, h5, h6, li, th, td, dt, dd, pre, address, aside, details, figcaption, summary)) {
-webkit-text-zoom: reset;
}

/* Sanitize phrasing/inline elements, their value should be the opposite of their parent element… */

:root:--ipadOS-patch abbr,
:root:--ipadOS-patch b,
:root:--ipadOS-patch bdi,
:root:--ipadOS-patch bdo,
:root:--ipadOS-patch cite,
:root:--ipadOS-patch code,
:root:--ipadOS-patch dfn,
:root:--ipadOS-patch em,
:root:--ipadOS-patch i,
:root:--ipadOS-patch kbd,
:root:--ipadOS-patch mark,
:root:--ipadOS-patch q,
:root:--ipadOS-patch rp,
:root:--ipadOS-patch rt,
:root:--ipadOS-patch ruby,
:root:--ipadOS-patch s,
:root:--ipadOS-patch samp,
:root:--ipadOS-patch small,
:root:--ipadOS-patch span,
:root:--ipadOS-patch strong,
:root:--ipadOS-patch sub,
:root:--ipadOS-patch sup,
:root:--ipadOS-patch time,
:root:--ipadOS-patch u,
:root:--ipadOS-patch var {
-webkit-text-zoom: normal;
}

/* Sanitize pseudo elements */

:root:--ipadOS-patch *:first-line,
:root:--ipadOS-patch *:first-letter {
-webkit-text-zoom: normal;
}