Skip to content

Commit e526358

Browse files
committed
Init ipadOS patch
1 parent 483a421 commit e526358

10 files changed

Lines changed: 328 additions & 5 deletions

css/ReadiumCSS-config.css

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,4 +45,7 @@
4545

4646
/* Direction i.e. ltr and rtl */
4747
@custom-selector :--ltr [dir="ltr"];
48-
@custom-selector :--rtl [dir="rtl"];
48+
@custom-selector :--rtl [dir="rtl"];
49+
50+
/* Patch for iPadOS */
51+
@custom-selector :--ipadOS-patch [style*="readium-iPadOSPatch-on"];

css/dist/ReadiumCSS-after.css

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -591,4 +591,63 @@ body{
591591
:root[style*="readium-normalize-on"][style*="--USER__typeScale"] h3{
592592
font-size:calc(1rem * var(--USER__typeScale)) !important;
593593
}
594+
}
595+
596+
:root[style*="readium-iPadOSPatch-on"] body{
597+
-webkit-text-size-adjust:none;
598+
}
599+
600+
:root[style*="readium-iPadOSPatch-on"] p,
601+
:root[style*="readium-iPadOSPatch-on"] h1,
602+
:root[style*="readium-iPadOSPatch-on"] h2,
603+
:root[style*="readium-iPadOSPatch-on"] h3,
604+
:root[style*="readium-iPadOSPatch-on"] h4,
605+
:root[style*="readium-iPadOSPatch-on"] h5,
606+
:root[style*="readium-iPadOSPatch-on"] h6,
607+
:root[style*="readium-iPadOSPatch-on"] li,
608+
:root[style*="readium-iPadOSPatch-on"] th,
609+
:root[style*="readium-iPadOSPatch-on"] td,
610+
:root[style*="readium-iPadOSPatch-on"] dt,
611+
:root[style*="readium-iPadOSPatch-on"] dd,
612+
:root[style*="readium-iPadOSPatch-on"] pre,
613+
:root[style*="readium-iPadOSPatch-on"] address,
614+
:root[style*="readium-iPadOSPatch-on"] details,
615+
:root[style*="readium-iPadOSPatch-on"] summary,
616+
:root[style*="readium-iPadOSPatch-on"] figcaption,
617+
: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)),
618+
: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)){
619+
-webkit-text-zoom:reset;
620+
}
621+
622+
:root[style*="readium-iPadOSPatch-on"] abbr,
623+
:root[style*="readium-iPadOSPatch-on"] b,
624+
:root[style*="readium-iPadOSPatch-on"] bdi,
625+
:root[style*="readium-iPadOSPatch-on"] bdo,
626+
:root[style*="readium-iPadOSPatch-on"] cite,
627+
:root[style*="readium-iPadOSPatch-on"] code,
628+
:root[style*="readium-iPadOSPatch-on"] dfn,
629+
:root[style*="readium-iPadOSPatch-on"] em,
630+
:root[style*="readium-iPadOSPatch-on"] i,
631+
:root[style*="readium-iPadOSPatch-on"] kbd,
632+
:root[style*="readium-iPadOSPatch-on"] mark,
633+
:root[style*="readium-iPadOSPatch-on"] q,
634+
:root[style*="readium-iPadOSPatch-on"] rp,
635+
:root[style*="readium-iPadOSPatch-on"] rt,
636+
:root[style*="readium-iPadOSPatch-on"] ruby,
637+
:root[style*="readium-iPadOSPatch-on"] s,
638+
:root[style*="readium-iPadOSPatch-on"] samp,
639+
:root[style*="readium-iPadOSPatch-on"] small,
640+
:root[style*="readium-iPadOSPatch-on"] span,
641+
:root[style*="readium-iPadOSPatch-on"] strong,
642+
:root[style*="readium-iPadOSPatch-on"] sub,
643+
:root[style*="readium-iPadOSPatch-on"] sup,
644+
:root[style*="readium-iPadOSPatch-on"] time,
645+
:root[style*="readium-iPadOSPatch-on"] u,
646+
:root[style*="readium-iPadOSPatch-on"] var{
647+
-webkit-text-zoom:normal;
648+
}
649+
650+
:root[style*="readium-iPadOSPatch-on"] *:first-line,
651+
:root[style*="readium-iPadOSPatch-on"] *:first-letter{
652+
-webkit-text-zoom:normal;
594653
}

css/dist/cjk-horizontal/ReadiumCSS-after.css

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -501,4 +501,63 @@ body{
501501
:root[style*="readium-normalize-on"][style*="--USER__typeScale"] h3{
502502
font-size:calc(1rem * var(--USER__typeScale)) !important;
503503
}
504+
}
505+
506+
:root[style*="readium-iPadOSPatch-on"] body{
507+
-webkit-text-size-adjust:none;
508+
}
509+
510+
:root[style*="readium-iPadOSPatch-on"] p,
511+
:root[style*="readium-iPadOSPatch-on"] h1,
512+
:root[style*="readium-iPadOSPatch-on"] h2,
513+
:root[style*="readium-iPadOSPatch-on"] h3,
514+
:root[style*="readium-iPadOSPatch-on"] h4,
515+
:root[style*="readium-iPadOSPatch-on"] h5,
516+
:root[style*="readium-iPadOSPatch-on"] h6,
517+
:root[style*="readium-iPadOSPatch-on"] li,
518+
:root[style*="readium-iPadOSPatch-on"] th,
519+
:root[style*="readium-iPadOSPatch-on"] td,
520+
:root[style*="readium-iPadOSPatch-on"] dt,
521+
:root[style*="readium-iPadOSPatch-on"] dd,
522+
:root[style*="readium-iPadOSPatch-on"] pre,
523+
:root[style*="readium-iPadOSPatch-on"] address,
524+
:root[style*="readium-iPadOSPatch-on"] details,
525+
:root[style*="readium-iPadOSPatch-on"] summary,
526+
:root[style*="readium-iPadOSPatch-on"] figcaption,
527+
: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)),
528+
: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)){
529+
-webkit-text-zoom:reset;
530+
}
531+
532+
:root[style*="readium-iPadOSPatch-on"] abbr,
533+
:root[style*="readium-iPadOSPatch-on"] b,
534+
:root[style*="readium-iPadOSPatch-on"] bdi,
535+
:root[style*="readium-iPadOSPatch-on"] bdo,
536+
:root[style*="readium-iPadOSPatch-on"] cite,
537+
:root[style*="readium-iPadOSPatch-on"] code,
538+
:root[style*="readium-iPadOSPatch-on"] dfn,
539+
:root[style*="readium-iPadOSPatch-on"] em,
540+
:root[style*="readium-iPadOSPatch-on"] i,
541+
:root[style*="readium-iPadOSPatch-on"] kbd,
542+
:root[style*="readium-iPadOSPatch-on"] mark,
543+
:root[style*="readium-iPadOSPatch-on"] q,
544+
:root[style*="readium-iPadOSPatch-on"] rp,
545+
:root[style*="readium-iPadOSPatch-on"] rt,
546+
:root[style*="readium-iPadOSPatch-on"] ruby,
547+
:root[style*="readium-iPadOSPatch-on"] s,
548+
:root[style*="readium-iPadOSPatch-on"] samp,
549+
:root[style*="readium-iPadOSPatch-on"] small,
550+
:root[style*="readium-iPadOSPatch-on"] span,
551+
:root[style*="readium-iPadOSPatch-on"] strong,
552+
:root[style*="readium-iPadOSPatch-on"] sub,
553+
:root[style*="readium-iPadOSPatch-on"] sup,
554+
:root[style*="readium-iPadOSPatch-on"] time,
555+
:root[style*="readium-iPadOSPatch-on"] u,
556+
:root[style*="readium-iPadOSPatch-on"] var{
557+
-webkit-text-zoom:normal;
558+
}
559+
560+
:root[style*="readium-iPadOSPatch-on"] *:first-line,
561+
:root[style*="readium-iPadOSPatch-on"] *:first-letter{
562+
-webkit-text-zoom:normal;
504563
}

css/dist/cjk-vertical/ReadiumCSS-after.css

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -489,4 +489,63 @@ body{
489489
:root[style*="readium-normalize-on"][style*="--USER__typeScale"] h3{
490490
font-size:calc(1rem * var(--USER__typeScale)) !important;
491491
}
492+
}
493+
494+
:root[style*="readium-iPadOSPatch-on"] body{
495+
-webkit-text-size-adjust:none;
496+
}
497+
498+
:root[style*="readium-iPadOSPatch-on"] p,
499+
:root[style*="readium-iPadOSPatch-on"] h1,
500+
:root[style*="readium-iPadOSPatch-on"] h2,
501+
:root[style*="readium-iPadOSPatch-on"] h3,
502+
:root[style*="readium-iPadOSPatch-on"] h4,
503+
:root[style*="readium-iPadOSPatch-on"] h5,
504+
:root[style*="readium-iPadOSPatch-on"] h6,
505+
:root[style*="readium-iPadOSPatch-on"] li,
506+
:root[style*="readium-iPadOSPatch-on"] th,
507+
:root[style*="readium-iPadOSPatch-on"] td,
508+
:root[style*="readium-iPadOSPatch-on"] dt,
509+
:root[style*="readium-iPadOSPatch-on"] dd,
510+
:root[style*="readium-iPadOSPatch-on"] pre,
511+
:root[style*="readium-iPadOSPatch-on"] address,
512+
:root[style*="readium-iPadOSPatch-on"] details,
513+
:root[style*="readium-iPadOSPatch-on"] summary,
514+
:root[style*="readium-iPadOSPatch-on"] figcaption,
515+
: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)),
516+
: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)){
517+
-webkit-text-zoom:reset;
518+
}
519+
520+
:root[style*="readium-iPadOSPatch-on"] abbr,
521+
:root[style*="readium-iPadOSPatch-on"] b,
522+
:root[style*="readium-iPadOSPatch-on"] bdi,
523+
:root[style*="readium-iPadOSPatch-on"] bdo,
524+
:root[style*="readium-iPadOSPatch-on"] cite,
525+
:root[style*="readium-iPadOSPatch-on"] code,
526+
:root[style*="readium-iPadOSPatch-on"] dfn,
527+
:root[style*="readium-iPadOSPatch-on"] em,
528+
:root[style*="readium-iPadOSPatch-on"] i,
529+
:root[style*="readium-iPadOSPatch-on"] kbd,
530+
:root[style*="readium-iPadOSPatch-on"] mark,
531+
:root[style*="readium-iPadOSPatch-on"] q,
532+
:root[style*="readium-iPadOSPatch-on"] rp,
533+
:root[style*="readium-iPadOSPatch-on"] rt,
534+
:root[style*="readium-iPadOSPatch-on"] ruby,
535+
:root[style*="readium-iPadOSPatch-on"] s,
536+
:root[style*="readium-iPadOSPatch-on"] samp,
537+
:root[style*="readium-iPadOSPatch-on"] small,
538+
:root[style*="readium-iPadOSPatch-on"] span,
539+
:root[style*="readium-iPadOSPatch-on"] strong,
540+
:root[style*="readium-iPadOSPatch-on"] sub,
541+
:root[style*="readium-iPadOSPatch-on"] sup,
542+
:root[style*="readium-iPadOSPatch-on"] time,
543+
:root[style*="readium-iPadOSPatch-on"] u,
544+
:root[style*="readium-iPadOSPatch-on"] var{
545+
-webkit-text-zoom:normal;
546+
}
547+
548+
:root[style*="readium-iPadOSPatch-on"] *:first-line,
549+
:root[style*="readium-iPadOSPatch-on"] *:first-letter{
550+
-webkit-text-zoom:normal;
492551
}

css/dist/rtl/ReadiumCSS-after.css

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -526,4 +526,63 @@ body{
526526
:root[style*="readium-normalize-on"][style*="--USER__typeScale"] h3{
527527
font-size:calc(1rem * var(--USER__typeScale)) !important;
528528
}
529+
}
530+
531+
:root[style*="readium-iPadOSPatch-on"] body{
532+
-webkit-text-size-adjust:none;
533+
}
534+
535+
:root[style*="readium-iPadOSPatch-on"] p,
536+
:root[style*="readium-iPadOSPatch-on"] h1,
537+
:root[style*="readium-iPadOSPatch-on"] h2,
538+
:root[style*="readium-iPadOSPatch-on"] h3,
539+
:root[style*="readium-iPadOSPatch-on"] h4,
540+
:root[style*="readium-iPadOSPatch-on"] h5,
541+
:root[style*="readium-iPadOSPatch-on"] h6,
542+
:root[style*="readium-iPadOSPatch-on"] li,
543+
:root[style*="readium-iPadOSPatch-on"] th,
544+
:root[style*="readium-iPadOSPatch-on"] td,
545+
:root[style*="readium-iPadOSPatch-on"] dt,
546+
:root[style*="readium-iPadOSPatch-on"] dd,
547+
:root[style*="readium-iPadOSPatch-on"] pre,
548+
:root[style*="readium-iPadOSPatch-on"] address,
549+
:root[style*="readium-iPadOSPatch-on"] details,
550+
:root[style*="readium-iPadOSPatch-on"] summary,
551+
:root[style*="readium-iPadOSPatch-on"] figcaption,
552+
: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)),
553+
: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)){
554+
-webkit-text-zoom:reset;
555+
}
556+
557+
:root[style*="readium-iPadOSPatch-on"] abbr,
558+
:root[style*="readium-iPadOSPatch-on"] b,
559+
:root[style*="readium-iPadOSPatch-on"] bdi,
560+
:root[style*="readium-iPadOSPatch-on"] bdo,
561+
:root[style*="readium-iPadOSPatch-on"] cite,
562+
:root[style*="readium-iPadOSPatch-on"] code,
563+
:root[style*="readium-iPadOSPatch-on"] dfn,
564+
:root[style*="readium-iPadOSPatch-on"] em,
565+
:root[style*="readium-iPadOSPatch-on"] i,
566+
:root[style*="readium-iPadOSPatch-on"] kbd,
567+
:root[style*="readium-iPadOSPatch-on"] mark,
568+
:root[style*="readium-iPadOSPatch-on"] q,
569+
:root[style*="readium-iPadOSPatch-on"] rp,
570+
:root[style*="readium-iPadOSPatch-on"] rt,
571+
:root[style*="readium-iPadOSPatch-on"] ruby,
572+
:root[style*="readium-iPadOSPatch-on"] s,
573+
:root[style*="readium-iPadOSPatch-on"] samp,
574+
:root[style*="readium-iPadOSPatch-on"] small,
575+
:root[style*="readium-iPadOSPatch-on"] span,
576+
:root[style*="readium-iPadOSPatch-on"] strong,
577+
:root[style*="readium-iPadOSPatch-on"] sub,
578+
:root[style*="readium-iPadOSPatch-on"] sup,
579+
:root[style*="readium-iPadOSPatch-on"] time,
580+
:root[style*="readium-iPadOSPatch-on"] u,
581+
:root[style*="readium-iPadOSPatch-on"] var{
582+
-webkit-text-zoom:normal;
583+
}
584+
585+
:root[style*="readium-iPadOSPatch-on"] *:first-line,
586+
:root[style*="readium-iPadOSPatch-on"] *:first-letter{
587+
-webkit-text-zoom:normal;
529588
}

css/src/ReadiumCSS-after-cjk-horizontal.css

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,4 +17,5 @@
1717
@import "modules/user-settings-submodules/ReadiumCSS-letterSpacing_pref.css";
1818
@import "modules/user-settings-submodules/ReadiumCSS-ruby_pref.css";
1919
@import "modules/user-settings-submodules/ReadiumCSS-imageFilters_pref.css";
20-
@import "modules/ReadiumCSS-fs_normalize.css";
20+
@import "modules/ReadiumCSS-fs_normalize.css";
21+
@import "modules/ReadiumCSS-iPadOS_patch.css";

css/src/ReadiumCSS-after-cjk-vertical.css

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,5 @@
1616
@import "modules/user-settings-submodules/ReadiumCSS-letterSpacing_pref.css";
1717
@import "modules/user-settings-submodules/ReadiumCSS-ruby_pref.css";
1818
@import "modules/user-settings-submodules/ReadiumCSS-imageFilters_pref.css";
19-
@import "modules/ReadiumCSS-fs_normalize.css";
19+
@import "modules/ReadiumCSS-fs_normalize.css";
20+
@import "modules/ReadiumCSS-iPadOS_patch.css";

css/src/ReadiumCSS-after-rtl.css

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,4 +19,5 @@
1919
@import "modules/user-settings-submodules/ReadiumCSS-arabicLigatures_pref.css";
2020
@import "modules/user-settings-submodules/ReadiumCSS-variableFont_pref.css";
2121
@import "modules/user-settings-submodules/ReadiumCSS-imageFilters_pref.css";
22-
@import "modules/ReadiumCSS-fs_normalize.css";
22+
@import "modules/ReadiumCSS-fs_normalize.css";
23+
@import "modules/ReadiumCSS-iPadOS_patch.css";

css/src/ReadiumCSS-after.css

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,4 +21,5 @@
2121
@import "modules/user-settings-submodules/ReadiumCSS-letterSpacing_pref.css";
2222
@import "modules/user-settings-submodules/ReadiumCSS-variableFont_pref.css";
2323
@import "modules/user-settings-submodules/ReadiumCSS-imageFilters_pref.css";
24-
@import "modules/ReadiumCSS-fs_normalize.css";
24+
@import "modules/ReadiumCSS-fs_normalize.css";
25+
@import "modules/ReadiumCSS-iPadOS_patch.css";
Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
/* Readium CSS
2+
iPadOS + desktop website Patch stylesheet
3+
4+
A set of style to get around iPadOS specific issues with zoom.
5+
This has to be applied when the desktop version is requested by iPadOS
6+
When the user requests the mobile version it is entirely fine and should
7+
not be used
8+
9+
See https://github.com/readium/readium-css/issues/172
10+
11+
Repo: https://github.com/readium/readium-css */
12+
13+
/* Disable iPadOS + desktop zoom intervention */
14+
15+
:root:--ipadOS-patch body {
16+
-webkit-text-size-adjust: none;
17+
}
18+
19+
/* There is nothing we can use in CSS to alternate the values so this will be high maintenance */
20+
21+
/* Sanitize flow/block elements, we have to reset them */
22+
23+
:root:--ipadOS-patch p,
24+
:root:--ipadOS-patch h1,
25+
:root:--ipadOS-patch h2,
26+
:root:--ipadOS-patch h3,
27+
:root:--ipadOS-patch h4,
28+
:root:--ipadOS-patch h5,
29+
:root:--ipadOS-patch h6,
30+
:root:--ipadOS-patch li,
31+
:root:--ipadOS-patch th,
32+
:root:--ipadOS-patch td,
33+
:root:--ipadOS-patch dt,
34+
:root:--ipadOS-patch dd,
35+
:root:--ipadOS-patch pre,
36+
:root:--ipadOS-patch address,
37+
:root:--ipadOS-patch details,
38+
:root:--ipadOS-patch summary,
39+
:root:--ipadOS-patch figcaption,
40+
:root:--ipadOS-patch div:not(:has(p, h1, h2, h3, h4, h5, h6, li, th, td, dt, dd, pre, address, aside, details, figcaption, summary)),
41+
:root:--ipadOS-patch aside:not(:has(p, h1, h2, h3, h4, h5, h6, li, th, td, dt, dd, pre, address, aside, details, figcaption, summary)) {
42+
-webkit-text-zoom: reset;
43+
}
44+
45+
/* Sanitize phrasing/inline elements, their value should be the opposite of their parent element… */
46+
47+
:root:--ipadOS-patch abbr,
48+
:root:--ipadOS-patch b,
49+
:root:--ipadOS-patch bdi,
50+
:root:--ipadOS-patch bdo,
51+
:root:--ipadOS-patch cite,
52+
:root:--ipadOS-patch code,
53+
:root:--ipadOS-patch dfn,
54+
:root:--ipadOS-patch em,
55+
:root:--ipadOS-patch i,
56+
:root:--ipadOS-patch kbd,
57+
:root:--ipadOS-patch mark,
58+
:root:--ipadOS-patch q,
59+
:root:--ipadOS-patch rp,
60+
:root:--ipadOS-patch rt,
61+
:root:--ipadOS-patch ruby,
62+
:root:--ipadOS-patch s,
63+
:root:--ipadOS-patch samp,
64+
:root:--ipadOS-patch small,
65+
:root:--ipadOS-patch span,
66+
:root:--ipadOS-patch strong,
67+
:root:--ipadOS-patch sub,
68+
:root:--ipadOS-patch sup,
69+
:root:--ipadOS-patch time,
70+
:root:--ipadOS-patch u,
71+
:root:--ipadOS-patch var {
72+
-webkit-text-zoom: normal;
73+
}
74+
75+
/* Sanitize pseudo elements */
76+
77+
:root:--ipadOS-patch *:first-line,
78+
:root:--ipadOS-patch *:first-letter {
79+
-webkit-text-zoom: normal;
80+
}

0 commit comments

Comments
 (0)