All Downloads are FREE. Search and download functionalities are using the official Maven repository.

css.volume-breaking.scss Maven / Gradle / Ivy

There is a newer version: 8.0.1
Show newest version
/**
 * Volume breaking
 */

$maximum-number-of-sheets: 70 !default;

@volume {
	max-length: $maximum-number-of-sheets;
}

/*
 * Amount with which volume breaks are allowed within "leaf sections", meaning that a
 * volume is not broken right before a heading.
 *
 * In order for this part of the style sheet to work, volume-breaking.xsl must be
 * included before volume-breaking.scss in the list of style sheets.
 *
 * A leaf section is a block of adjacent content with the same sectioning depth.
 * Which means:
 * - either; a section element with no child sections
 * - or; the content in a section (

,

, etc.), which may have section element siblings * * If a section contains other sections, then volume-breaking.xsl wraps the normal content * (

,

, etc.) in the section in a

element. */ $allow-volume-break-inside-leaf-section-factor: 10 !default; /** * Amount with which preference is given to volume breaks before higher level sections in * comparison to lower level sections. * * The value can range from 0 to ? and can be a non-integer. A value of 0 (the default) means * no preference is given. A higher value results in volumes that are less equal in * size. Depending on the value of $allow-volume-break-inside-leaf-section-factor, * increasing $prefer-volume-break-before-higher-level-factor beyond a certain value does * not have an effect anymore. */ $prefer-volume-break-before-higher-level-factor: 0 !default; @if $allow-volume-break-inside-leaf-section-factor < 10 { $min-volume-keep-priority: min(10, max(1, round($allow-volume-break-inside-leaf-section-factor))); @if $min-volume-keep-priority < 10 { section, div.leaf-section { volume-break-inside: -obfl-keep($min-volume-keep-priority); } @if $prefer-volume-break-before-higher-level-factor > 0 { $level: 1; $volume-keep-priority: min(10, max($min-volume-keep-priority, round(10 - $level * $prefer-volume-break-before-higher-level-factor))); @if $volume-keep-priority > $min-volume-keep-priority { section { @if $volume-keep-priority < 10 { &:has(> section, > div.leaf-section) { volume-break-inside: -obfl-keep($volume-keep-priority); } } $level: $level + 1; $volume-keep-priority: min(10, max($min-volume-keep-priority, round(10 - $level * $prefer-volume-break-before-higher-level-factor))); @if $volume-keep-priority > $min-volume-keep-priority { & > section { @if $volume-keep-priority < 10 { &:has(> section, > div.leaf-section) { volume-break-inside: -obfl-keep($volume-keep-priority); } } $level: $level + 1; $volume-keep-priority: min(10, max($min-volume-keep-priority, round(10 - $level * $prefer-volume-break-before-higher-level-factor))); @if $volume-keep-priority > $min-volume-keep-priority { & > section { @if $volume-keep-priority < 10 { &:has(> section, > div.leaf-section) { volume-break-inside: -obfl-keep($volume-keep-priority); } } $level: $level + 1; $volume-keep-priority: min(10, max($min-volume-keep-priority, round(10 - $level * $prefer-volume-break-before-higher-level-factor))); @if $volume-keep-priority > $min-volume-keep-priority { & > section { @if $volume-keep-priority < 10 { &:has(> section, > div.leaf-section) { volume-break-inside: -obfl-keep($volume-keep-priority); } } $level: $level + 1; $volume-keep-priority: min(10, max($min-volume-keep-priority, round(10 - $level * $prefer-volume-break-before-higher-level-factor))); @if $volume-keep-priority > $min-volume-keep-priority { & > section { @if $volume-keep-priority < 10 { &:has(> section, > div.leaf-section) { volume-break-inside: -obfl-keep($volume-keep-priority); } } $level: $level + 1; $volume-keep-priority: min(10, max($min-volume-keep-priority, round(10 - $level * $prefer-volume-break-before-higher-level-factor))); @if $volume-keep-priority > $min-volume-keep-priority { & > section { @if $volume-keep-priority < 10 { &:has(> section, > div.leaf-section) { volume-break-inside: -obfl-keep($volume-keep-priority); } } $level: $level + 1; $volume-keep-priority: min(10, max($min-volume-keep-priority, round(10 - $level * $prefer-volume-break-before-higher-level-factor))); @if $volume-keep-priority > $min-volume-keep-priority { & > section { @if $volume-keep-priority < 10 { &:has(> section, > div.leaf-section) { volume-break-inside: -obfl-keep($volume-keep-priority); } } $level: $level + 1; $volume-keep-priority: min(10, max($min-volume-keep-priority, round(10 - $level * $prefer-volume-break-before-higher-level-factor))); @if $volume-keep-priority > $min-volume-keep-priority { & > section { @if $volume-keep-priority < 10 { &:has(> section, > div.leaf-section) { volume-break-inside: -obfl-keep($volume-keep-priority); } } $level: $level + 1; $volume-keep-priority: min(10, max($min-volume-keep-priority, round(10 - $level * $prefer-volume-break-before-higher-level-factor))); @if $volume-keep-priority > $min-volume-keep-priority { & > section { @if $volume-keep-priority < 10 { &:has(> section, > div.leaf-section) { volume-break-inside: -obfl-keep($volume-keep-priority); } } $level: $level + 1; $volume-keep-priority: min(10, max($min-volume-keep-priority, round(10 - $level * $prefer-volume-break-before-higher-level-factor))); @if $volume-keep-priority > $min-volume-keep-priority { & > section { @if $volume-keep-priority < 10 { &:has(> section, > div.leaf-section) { volume-break-inside: -obfl-keep($volume-keep-priority); } } } } } } } } } } } } } } } } } } } } } } } } /* * Avoid orphaned headlines. * * volume-breaking.xsl adds the "keep-with-next-section" class is added on small leaf * sections. */ .keep-with-next-section { -obfl-keep-with-next-sheets: 1; } }





© 2015 - 2025 Weber Informatics LLC | Privacy Policy