Skip to content

Commit

Permalink
Set fallback 'contain' properties
Browse files Browse the repository at this point in the history
  • Loading branch information
AbeJellinek committed Aug 21, 2023
1 parent b8266cf commit ed852fa
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions src/dom/epub/stylesheets/content.css
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,11 @@ body.flow-mode-scrolled > .sections > .section-container {
margin-inline: auto;
margin-bottom: 100px;
max-width: 800px;
/* Try some different permutations of the 'contain' values that we want, because Firefox, at least, seems to throw
away the whole property when it sees an unknown value. */
contain: layout paint;
contain: layout paint style;
contain: layout paint inline-size;
contain: layout paint style inline-size;
}

Expand Down Expand Up @@ -111,6 +116,8 @@ body.flow-mode-paginated > .sections.spread-mode-odd {
}

body.flow-mode-paginated > .sections > .section-container {
/* See above: Firefox throws away 'contain' properties with unknown values, so we need to set a fallback. */
contain: layout paint;
contain: layout paint style;
}

Expand Down Expand Up @@ -153,7 +160,7 @@ replaced-body {
margin-left: 0 !important;
margin-right: 0 !important;
background: transparent !important;

font-family: var(--content-font-family, "Georgia"), serif;
font-size: calc(var(--content-scale) * 13pt) !important;
line-height: 1.4;
Expand All @@ -164,7 +171,7 @@ replaced-body p {
/* Really enforce some of our formatting choices on body paragraphs */
font-family: var(--content-font-family, "Georgia"), serif !important;
line-height: 1.4 !important;

widows: 2;
orphans: 2;
}
Expand Down

0 comments on commit ed852fa

Please sign in to comment.