diff --git a/modules/nlb/book-to-pef/src/main/resources/css/nlb-default.scss b/modules/nlb/book-to-pef/src/main/resources/css/nlb-default.scss index 5bb3b3cef1..cdf265b9c9 100644 --- a/modules/nlb/book-to-pef/src/main/resources/css/nlb-default.scss +++ b/modules/nlb/book-to-pef/src/main/resources/css/nlb-default.scss @@ -164,6 +164,15 @@ level4 ~ level4 { volume-break-inside: -obfl-keep(5); } level5 ~ level5 { volume-break-inside: -obfl-keep(4); } level6 ~ level6 { volume-break-inside: -obfl-keep(3); } +@for $i from 1 through 6 { + h#{$i} { + -obfl-keep-with-next-sheets: 1; + } + level#{$i} ~ level#{$i} > h#{$i} { + -obfl-keep-with-next-sheets: 0; + } +} + /* Volume breaking rules based on level depth: EPUB/HTML */ html:has(body ~ body) > body, html:not(:has(body ~ body)) > body > section { &:not(.pef-titlepage):not(.pef-about):not(:has(> #generated-volume-toc)):not(:has(> #generated-document-toc)) {