
css._volume-breaking.scss Maven / Gradle / Ivy
The newest version!
/**
* Volume breaking
*/
/**
* @var integer $maximum-number-of-sheets
*
* @brief Maximum number of sheets per volume
*
* The maximum number of sheets in a volume.
*
* The following CSS rule is included by default (where `$maximum-number-of-sheets` is the value of
* this option):
*
* ~~~sass
* @volume {
* max-length: $maximum-number-of-sheets;
* }
* ~~~
*
* See the CSS specification for more info:
*
* - the [`@volume`](http://braillespecs.github.io/braille-css/#h3_the-volume-rule) rule
* - the [`max-length`](http://braillespecs.github.io/braille-css/#h3_the-length-properties) property
*/
$maximum-number-of-sheets: 70 !default;
@-daisy-volume {
max-length: $maximum-number-of-sheets;
}
/**
* @var integer $allow-volume-break-inside-leaf-section-factor
*
* @brief Allow volume breaks within sections
*
* Amount with which volume breaks are allowed within sections.
*
* The value can range from 1 to 10. The lower the value, the more preference is given to volume breaks
* right before or after elements `level1` to `level6`. The higher the value, the more equal the volumes
* will be in size.
*/
$allow-volume-break-inside-leaf-section-factor: 10 !default;
// Allowing volume breaks within "leaf sections" means allowing a volume to be broken not
// right before a heading.
//
// 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 this style sheet wraps the normal content
// (
,
, etc.) in the section in a
element.
/**
* @var string $prefer-volume-break-before-higher-level-factor
*
* @brief Prefer breaks at higher level sections
*
* Amount with which preference is given to volume breaks before higher level sections.
*
* `level1` is the highest level. The value must be greater or equal to 0. It can be a non-integer. A
* value of 0 means no preference is given. A higher value results in volumes that are less equal in
* size.
*/
$prefer-volume-break-before-higher-level-factor: 0 !default;
// 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.
$min-volume-keep-priority: min(10, max(1, round($allow-volume-break-inside-leaf-section-factor)));
@if $min-volume-keep-priority < 10 {
$duplex: true !default;
@-daisy-xslt "volume-breaking.xsl" {
duplex: $duplex;
maximum-number-of-sheets: $maximum-number-of-sheets;
allow-volume-break-inside-leaf-section-factor: $allow-volume-break-inside-leaf-section-factor;
prefer-volume-break-before-higher-level-factor: $prefer-volume-break-before-higher-level-factor;
}
@if $prefer-volume-break-before-higher-level-factor > 0 {
@for $level from 1 through 6 {
$volume-keep-priority: min(10, max($min-volume-keep-priority, round(10 - $level * $prefer-volume-break-before-higher-level-factor)));
@if $volume-keep-priority < 10 {
level#{$level} {
-daisy-volume-break-inside: -obfl-keep($volume-keep-priority);
}
}
}
}
level1:not(:has(> level2, div.leaf-section)),
level2:not(:has(> level3, div.leaf-section)),
level3:not(:has(> level4, div.leaf-section)),
level4:not(:has(> level5, div.leaf-section)),
level5:not(:has(> level6, div.leaf-section)),
level6:not(:has(div.leaf-section)),
div.leaf-section {
-daisy-volume-break-inside: -obfl-keep($min-volume-keep-priority);
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy