Skip to content

Commit 5532127

Browse files
committed
Add flag to disable overflow
1 parent f46eb46 commit 5532127

13 files changed

Lines changed: 96 additions & 35 deletions

css/ReadiumCSS-config.css

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,9 @@
3434
/* Disabling pagination for vertical writing */
3535
@custom-selector :--no-vertical-pagination [style*="readium-noVerticalPagination-on"];
3636

37+
/* Disabling overflow */
38+
@custom-selector :--no-overflow [style*="readium-noOverflow-on"];
39+
3740
/* Hiding ruby */
3841
@custom-selector :--no-ruby [style*="readium-noRuby-on"];
3942

css/dist/ReadiumCSS-after.css

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -66,17 +66,20 @@ body{
6666
max-width:var(--RS__defaultLineLength) !important;
6767
padding:0 var(--RS__pageGutter) !important;
6868
margin:0 auto !important;
69-
overflow:hidden;
7069
box-sizing:border-box;
7170
}
7271

72+
:root:not([style*="readium-noOverflow-on"]) body{
73+
overflow:hidden;
74+
}
75+
7376
@supports (overflow: clip){
7477

75-
:root{
78+
:root:not([style*="readium-noOverflow-on"]){
7679
overflow:clip;
7780
}
7881

79-
body{
82+
:root:not([style*="readium-noOverflow-on"]) body{
8083
overflow:clip;
8184
overflow-clip-margin:content-box;
8285
}
@@ -94,18 +97,18 @@ body{
9497
min-height:0 !important;
9598
}
9699

97-
:root[style*="readium-scroll-on"] body{
100+
:root[style*="readium-scroll-on"]:not([style*="readium-noOverflow-on"]) body{
98101
max-width:var(--RS__defaultLineLength) !important;
99102
overflow:auto;
100103
}
101104

102105
@supports (overflow: clip){
103106

104-
:root[style*="readium-scroll-on"]{
107+
:root[style*="readium-scroll-on"]:not([style*="readium-noOverflow-on"]){
105108
overflow:auto;
106109
}
107110

108-
:root[style*="readium-scroll-on"] body{
111+
:root[style*="readium-scroll-on"]:not([style*="readium-noOverflow-on"]) body{
109112
overflow:clip;
110113
}
111114
}

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

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -66,17 +66,20 @@ body{
6666
max-width:var(--RS__defaultLineLength) !important;
6767
padding:0 var(--RS__pageGutter) !important;
6868
margin:0 auto !important;
69-
overflow:hidden;
7069
box-sizing:border-box;
7170
}
7271

72+
:root:not([style*="readium-noOverflow-on"]) body{
73+
overflow:hidden;
74+
}
75+
7376
@supports (overflow: clip){
7477

75-
:root{
78+
:root:not([style*="readium-noOverflow-on"]){
7679
overflow:clip;
7780
}
7881

79-
body{
82+
:root:not([style*="readium-noOverflow-on"]) body{
8083
overflow:clip;
8184
overflow-clip-margin:content-box;
8285
}
@@ -94,18 +97,18 @@ body{
9497
min-height:0 !important;
9598
}
9699

97-
:root[style*="readium-scroll-on"] body{
100+
:root[style*="readium-scroll-on"]:not([style*="readium-noOverflow-on"]) body{
98101
max-width:var(--RS__defaultLineLength) !important;
99102
overflow:auto;
100103
}
101104

102105
@supports (overflow: clip){
103106

104-
:root[style*="readium-scroll-on"]{
107+
:root[style*="readium-scroll-on"]:not([style*="readium-noOverflow-on"]){
105108
overflow:auto;
106109
}
107110

108-
:root[style*="readium-scroll-on"] body{
111+
:root[style*="readium-scroll-on"]:not([style*="readium-noOverflow-on"]) body{
109112
overflow:clip;
110113
}
111114
}

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

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -77,17 +77,20 @@ body{
7777
max-height:var(--RS__defaultLineLength) !important;
7878
padding:var(--RS__pageGutter) 0 !important;
7979
margin:auto 0 !important;
80-
overflow:hidden;
8180
box-sizing:border-box;
8281
}
8382

83+
:root:not([style*="readium-noOverflow-on"]) body{
84+
overflow:hidden;
85+
}
86+
8487
@supports (overflow: clip){
8588

86-
:root{
89+
:root:not([style*="readium-noOverflow-on"]){
8790
overflow:clip;
8891
}
8992

90-
body{
93+
:root:not([style*="readium-noOverflow-on"]) body{
9194
overflow:clip;
9295
overflow-clip-margin:content-box;
9396
}
@@ -111,11 +114,11 @@ body{
111114

112115
@supports (overflow: clip){
113116

114-
:root[style*="readium-scroll-on"]{
117+
:root[style*="readium-scroll-on"]:not([style*="readium-noOverflow-on"]){
115118
overflow:auto;
116119
}
117120

118-
:root[style*="readium-scroll-on"] body{
121+
:root[style*="readium-scroll-on"]:not([style*="readium-noOverflow-on"]) body{
119122
overflow:clip;
120123
}
121124
}

css/dist/rtl/ReadiumCSS-after.css

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -66,17 +66,20 @@ body{
6666
max-width:var(--RS__defaultLineLength) !important;
6767
padding:0 var(--RS__pageGutter) !important;
6868
margin:0 auto !important;
69-
overflow:hidden;
7069
box-sizing:border-box;
7170
}
7271

72+
:root:not([style*="readium-noOverflow-on"]) body{
73+
overflow:hidden;
74+
}
75+
7376
@supports (overflow: clip){
7477

75-
:root{
78+
:root:not([style*="readium-noOverflow-on"]){
7679
overflow:clip;
7780
}
7881

79-
body{
82+
:root:not([style*="readium-noOverflow-on"]) body{
8083
overflow:clip;
8184
overflow-clip-margin:content-box;
8285
}
@@ -94,18 +97,18 @@ body{
9497
min-height:0 !important;
9598
}
9699

97-
:root[style*="readium-scroll-on"] body{
100+
:root[style*="readium-scroll-on"]:not([style*="readium-noOverflow-on"]) body{
98101
max-width:var(--RS__defaultLineLength) !important;
99102
overflow:auto;
100103
}
101104

102105
@supports (overflow: clip){
103106

104-
:root[style*="readium-scroll-on"]{
107+
:root[style*="readium-scroll-on"]:not([style*="readium-noOverflow-on"]){
105108
overflow:auto;
106109
}
107110

108-
:root[style*="readium-scroll-on"] body{
111+
:root[style*="readium-scroll-on"]:not([style*="readium-noOverflow-on"]) body{
109112
overflow:clip;
110113
}
111114
}

css/src/modules/ReadiumCSS-pagination-vertical.css

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,6 @@
8282
}
8383

8484
body {
85-
overflow: hidden;
8685
width: 100%;
8786

8887
/* Limit line-length but we have to reset when 2 columns and control the viewport.
@@ -98,12 +97,16 @@ body {
9897
padding: var(--RS__pageGutter) 0 !important;
9998
}
10099

100+
:root:not(:--no-overflow) body {
101+
overflow: hidden;
102+
}
103+
101104
@supports (overflow: clip) {
102-
:root {
105+
:root:not(:--no-overflow) {
103106
overflow: clip;
104107
}
105108

106-
body {
109+
:root:not(:--no-overflow) body {
107110
overflow: clip;
108111
overflow-clip-margin: content-box;
109112
}

css/src/modules/ReadiumCSS-pagination.css

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,6 @@
6868
}
6969

7070
body {
71-
overflow: hidden;
7271
width: 100%;
7372

7473
/* Limit line-length but we have to reset when 2 columns and control the viewport.
@@ -84,12 +83,16 @@ body {
8483
padding: 0 var(--RS__pageGutter) !important;
8584
}
8685

86+
:root:not(:--no-overflow) body {
87+
overflow: hidden;
88+
}
89+
8790
@supports (overflow: clip) {
88-
:root {
91+
:root:not(:--no-overflow) {
8992
overflow: clip;
9093
}
9194

92-
body {
95+
:root:not(:--no-overflow) body {
9396
overflow: clip;
9497
overflow-clip-margin: content-box;
9598
}

css/src/modules/ReadiumCSS-scroll-vertical.css

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,11 +28,11 @@
2828
}
2929

3030
@supports (overflow: clip) {
31-
:root:--scroll-view {
31+
:root:--scroll-view:not(:--no-overflow) {
3232
overflow: auto;
3333
}
3434

35-
:root:--scroll-view body {
35+
:root:--scroll-view:not(:--no-overflow) body {
3636
overflow: clip;
3737
}
3838
}

css/src/modules/ReadiumCSS-scroll.css

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,17 +22,17 @@
2222
}
2323

2424
/* Make sure line-length is limited in all configs */
25-
:root:--scroll-view body {
25+
:root:--scroll-view:not(:--no-overflow) body {
2626
overflow: auto;
2727
max-width: var(--RS__defaultLineLength) !important;
2828
}
2929

3030
@supports (overflow: clip) {
31-
:root:--scroll-view {
31+
:root:--scroll-view:not(:--no-overflow) {
3232
overflow: auto;
3333
}
3434

35-
:root:--scroll-view body {
35+
:root:--scroll-view:not(:--no-overflow) body {
3636
overflow: clip;
3737
}
3838
}

docs/CSS19-api.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -201,6 +201,18 @@ Scope: `html`
201201

202202
Override class: None. It’s a flag meant for implementers’ convenience as it disables vertical-writing pagination so that they can implement theirs.
203203

204+
* * *
205+
206+
```
207+
:--no-overflow
208+
```
209+
210+
Preset: `--RS__disableOverflow: readium-noOverflow-on`
211+
212+
Scope: `html`
213+
214+
Override class: None. It’s a flag meant for implementers’ convenience as it disables overflow so that they can implement theirs.
215+
204216
* * *
205217

206218
```

0 commit comments

Comments
 (0)