buckram 1.8.8 → 1.9.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,3 +1,3 @@
1
1
  {
2
- ".": "1.8.8"
2
+ ".": "1.9.1"
3
3
  }
package/CHANGELOG.md CHANGED
@@ -1,5 +1,20 @@
1
1
  # Changelog
2
2
 
3
+ ## [1.9.1](https://github.com/pressbooks/buckram/compare/v1.9.0...v1.9.1) (2026-04-28)
4
+
5
+
6
+ ### Bug Fixes
7
+
8
+ * **deps:** bump pressbooks-build-tools to v6 ([#408](https://github.com/pressbooks/buckram/issues/408)) ([893d388](https://github.com/pressbooks/buckram/commit/893d38867cc0ce6b703438ea212ce824c7c939d6))
9
+ * set tag types for TOC properly in PDF exports ([#395](https://github.com/pressbooks/buckram/issues/395)) ([b9ecded](https://github.com/pressbooks/buckram/commit/b9ecdedd5366a0bb982b20eed3283224ac3ccef8))
10
+
11
+ ## [1.9.0](https://github.com/pressbooks/buckram/compare/v1.8.8...v1.9.0) (2026-04-15)
12
+
13
+
14
+ ### Features
15
+
16
+ * prince 16 support ([#411](https://github.com/pressbooks/buckram/issues/411)) ([6a0460a](https://github.com/pressbooks/buckram/commit/6a0460a4e0e554e9a7547d5ca313a32d0dfe9a9b))
17
+
3
18
  ## [1.8.8](https://github.com/pressbooks/buckram/compare/v1.8.7...v1.8.8) (2025-10-02)
4
19
 
5
20
 
@@ -19,6 +19,7 @@
19
19
  word-spacing: if-map-get($blockquote-word-spacing, $type);
20
20
  border-left: if-map-get($blockquote-border-left-width, $type) $blockquote-border-left-style;
21
21
  border-left-color: $blockquote-border-left-color;
22
+ box-decoration-break: $box-decoration-break;
22
23
  @if $type == 'prince' {
23
24
  line-height: $blockquote-line-height;
24
25
  }
@@ -134,6 +134,7 @@
134
134
  ol {
135
135
  margin-top: $endnote-ol-margin-top;
136
136
  margin-left: $endnote-ol-margin-left;
137
+ padding-left: $endnote-ol-padding-left;
137
138
  font-size: $endnote-ol-font-size;
138
139
  list-style-position: outside;
139
140
  }
@@ -21,6 +21,7 @@ aside,
21
21
  border-right: $aside-border-right;
22
22
  border-bottom: $aside-border-bottom;
23
23
  border-left: $aside-border-left;
24
+ box-decoration-break: $box-decoration-break;
24
25
  }
25
26
 
26
27
  // Pullquotes
@@ -113,15 +113,18 @@
113
113
  border-style: $textbox-border-style;
114
114
  border-width: if-map-get($textbox-border-width, $type);
115
115
  border-radius: if-map-get($textbox-border-radius, $type);
116
+ box-decoration-break: $box-decoration-break;
116
117
 
117
118
  ul {
118
119
  margin-top: $textbox-ul-margin-top;
119
120
  margin-bottom: $textbox-ul-margin-bottom;
121
+ padding-left: $textbox-ul-padding-left;
120
122
  }
121
123
 
122
124
  ol {
123
125
  margin-top: $textbox-ol-margin-top;
124
126
  margin-bottom: $textbox-ol-margin-bottom;
127
+ padding-left: $textbox-ol-padding-left;
125
128
  }
126
129
 
127
130
  li {
@@ -14,7 +14,7 @@
14
14
  @each $page-type in
15
15
  'front-matter:#{$page-position}' {
16
16
  @page #{$page-type} {
17
- @if $page-position == 'first:left' {
17
+ @if $page-position == 'first-of-group:left' {
18
18
  @if if-map-get($content-position, left) {
19
19
  @include position(if-map-get($content-position, left)) {
20
20
  @if head-or-foot(if-map-get($content-position, left)) == 'head' {
@@ -26,7 +26,7 @@
26
26
  @include front-matter-page-number;
27
27
  }
28
28
  }
29
- } @else if $page-position == 'first:right' {
29
+ } @else if $page-position == 'first-of-group:right' {
30
30
  @if if-map-get($content-position, right) {
31
31
  @include position(if-map-get($content-position, right)) {
32
32
  @if head-or-foot(if-map-get($content-position, right)) == 'head' {
@@ -59,7 +59,7 @@
59
59
  'chapter:#{$page-position}',
60
60
  'back-matter:#{$page-position}' {
61
61
  @page #{$page-type} {
62
- @if $page-position == 'first:left' {
62
+ @if $page-position == 'first-of-group:left' {
63
63
  @if if-map-get($content-position, left) {
64
64
  @include position(if-map-get($content-position, left)) {
65
65
  @if head-or-foot(if-map-get($content-position, left)) == 'head' {
@@ -71,7 +71,7 @@
71
71
  @include page-number;
72
72
  }
73
73
  }
74
- } @else if $page-position == 'first:right' {
74
+ } @else if $page-position == 'first-of-group:right' {
75
75
  @if if-map-get($content-position, right) {
76
76
  @include position(if-map-get($content-position, right)) {
77
77
  @if head-or-foot(if-map-get($content-position, right)) == 'head' {
@@ -217,7 +217,7 @@
217
217
  'chapter:#{$page-position}',
218
218
  'back-matter:#{$page-position}' {
219
219
  @page #{$page-type} {
220
- @if $page-position == 'first:left' {
220
+ @if $page-position == 'first-of-group:left' {
221
221
  @if if-map-get($content-position, left) {
222
222
  @include position(if-map-get($content-position, left)) {
223
223
  padding-top: $runninghead-padding-top;
@@ -232,7 +232,7 @@
232
232
  text-transform: $runninghead-left-text-transform;
233
233
  }
234
234
  }
235
- } @else if $page-position == 'first:right' {
235
+ } @else if $page-position == 'first-of-group:right' {
236
236
  @if if-map-get($content-position, right) {
237
237
  @include position(if-map-get($content-position, right)) {
238
238
  padding-top: $runninghead-padding-top;
@@ -290,7 +290,7 @@
290
290
  'chapter:#{$page-position}',
291
291
  'back-matter:#{$page-position}' {
292
292
  @page #{$page-type} {
293
- @if $page-position == 'first:left' {
293
+ @if $page-position == 'first-of-group:left' {
294
294
  @if if-map-get($content-position, left) {
295
295
  @include position(if-map-get($content-position, left)) {
296
296
  padding-bottom: $runningfoot-padding-bottom;
@@ -305,7 +305,7 @@
305
305
  text-transform: $runningfoot-left-text-transform;
306
306
  }
307
307
  }
308
- } @else if $page-position == 'first:right' {
308
+ } @else if $page-position == 'first-of-group:right' {
309
309
  @if if-map-get($content-position, right) {
310
310
  @include position(if-map-get($content-position, right)) {
311
311
  padding-bottom: $runningfoot-padding-bottom;
@@ -359,7 +359,7 @@
359
359
  @mixin page-structure($page-type, $page-position, $numbering-position, $running-content-position) {
360
360
  @if $numbering-position and $running-content-position {
361
361
  @if $numbering-position == $running-content-position {
362
- @if $page-position != 'first' {
362
+ @if $page-position != 'first-of-group' {
363
363
  @page #{$page-type}:#{$page-position} {
364
364
  @include position($running-content-position) {
365
365
  @if $page-position == 'left' {
@@ -384,7 +384,7 @@
384
384
  }
385
385
  }
386
386
  } @else {
387
- @page #{$page-type}:first:right {
387
+ @page #{$page-type}:first-of-group:right {
388
388
  @include position(if-map-get($running-content-position, right)) {
389
389
  @if if-map-get($running-content-position, right) == '@bottom-left'
390
390
  or if-map-get($running-content-position, right) == '@bottom-left-corner'
@@ -396,7 +396,7 @@
396
396
  }
397
397
  }
398
398
 
399
- @page #{$page-type}:first:left {
399
+ @page #{$page-type}:first-of-group:left {
400
400
  @include position(if-map-get($running-content-position, left)) {
401
401
  @if if-map-get($running-content-position, left) == '@bottom-right'
402
402
  or if-map-get($running-content-position, left) == '@bottom-right-corner'
@@ -409,7 +409,7 @@
409
409
  }
410
410
  }
411
411
  } @else {
412
- @if $page-position != 'first' {
412
+ @if $page-position != 'first-of-group' {
413
413
  @page #{$page-type}:#{$page-position} {
414
414
  @include position($running-content-position) {
415
415
  @if $page-position == 'left' {
@@ -429,7 +429,7 @@
429
429
 
430
430
  }
431
431
  } @else {
432
- @page #{$page-type}:first:right {
432
+ @page #{$page-type}:first-of-group:right {
433
433
  @include position(if-map-get($running-content-position, right)) {
434
434
  content: if-map-get($right-running-content, $page-type);
435
435
  }
@@ -438,7 +438,7 @@
438
438
  }
439
439
  }
440
440
 
441
- @page #{$page-type}:first:left {
441
+ @page #{$page-type}:first-of-group:left {
442
442
  @include position(if-map-get($running-content-position, left)) {
443
443
  content: if-map-get($left-running-content, $page-type);
444
444
  }
@@ -450,7 +450,7 @@
450
450
  }
451
451
  } @else {
452
452
  @if $numbering-position {
453
- @if $page-position != 'first' {
453
+ @if $page-position != 'first-of-group' {
454
454
  @page #{$page-type}:#{$page-position} {
455
455
  @include position($numbering-position) {
456
456
  @if $page-position == 'left' {
@@ -461,13 +461,13 @@
461
461
  }
462
462
  }
463
463
  } @else {
464
- @page #{$page-type}:first:right {
464
+ @page #{$page-type}:first-of-group:right {
465
465
  @include position(if-map-get($numbering-position, right)) {
466
466
  content: if-map-get($right-page-number, $page-type);
467
467
  }
468
468
  }
469
469
 
470
- @page #{$page-type}:first:left {
470
+ @page #{$page-type}:first-of-group:left {
471
471
  @include position(if-map-get($numbering-position, left)) {
472
472
  content: if-map-get($left-page-number, $page-type);
473
473
  }
@@ -476,7 +476,7 @@
476
476
  }
477
477
 
478
478
  @if $running-content-position {
479
- @if $page-position != 'first' {
479
+ @if $page-position != 'first-of-group' {
480
480
  @page #{$page-type}:#{$page-position} {
481
481
  @include position($running-content-position) {
482
482
  @if $page-position == 'left' {
@@ -487,13 +487,13 @@
487
487
  }
488
488
  }
489
489
  } @else {
490
- @page #{$page-type}:first:right {
490
+ @page #{$page-type}:first-of-group:right {
491
491
  @include position(if-map-get($running-content-position, right)) {
492
492
  content: if-map-get($right-running-content, $page-type);
493
493
  }
494
494
  }
495
495
 
496
- @page #{$page-type}:first:left {
496
+ @page #{$page-type}:first-of-group:left {
497
497
  @include position(if-map-get($running-content-position, left)) {
498
498
  content: if-map-get($left-running-content, $page-type);
499
499
  }
@@ -51,8 +51,8 @@ $right-page-number: (
51
51
 
52
52
  // Now we style the appropriate location using our page-numbers mixin.
53
53
 
54
- @include page-numbers('first:left', convert-position('first', $first-numbering-position));
55
- @include page-numbers('first:right', convert-position('first', $first-numbering-position));
54
+ @include page-numbers('first-of-group:left', convert-position('first', $first-numbering-position));
55
+ @include page-numbers('first-of-group:right', convert-position('first', $first-numbering-position));
56
56
  @include page-numbers('left', convert-position('left', $numbering-position));
57
57
  @include page-numbers('right', convert-position('right', $numbering-position));
58
58
 
@@ -62,13 +62,13 @@ $right-page-number: (
62
62
  // Now we style the appropriate location using our runninghead or runningfoot mixin.
63
63
 
64
64
  @if head-or-foot($running-content-position) == 'head' {
65
- @include runninghead('first:left', convert-position('first', $first-running-content-position));
66
- @include runninghead('first:right', convert-position('first', $first-running-content-position));
65
+ @include runninghead('first-of-group:left', convert-position('first', $first-running-content-position));
66
+ @include runninghead('first-of-group:right', convert-position('first', $first-running-content-position));
67
67
  @include runninghead('left', convert-position('left', $running-content-position));
68
68
  @include runninghead('right', convert-position('right', $running-content-position));
69
69
  } @else if head-or-foot($running-content-position) == 'foot' {
70
- @include runningfoot('first:left', convert-position('first', $first-running-content-position));
71
- @include runningfoot('first:right', convert-position('first', $first-running-content-position));
70
+ @include runningfoot('first-of-group:left', convert-position('first', $first-running-content-position));
71
+ @include runningfoot('first-of-group:right', convert-position('first', $first-running-content-position));
72
72
  @include runningfoot('left', convert-position('left', $running-content-position));
73
73
  @include runningfoot('right', convert-position('right', $running-content-position));
74
74
  }
@@ -80,56 +80,56 @@ $right-page-number: (
80
80
  // depending on section type
81
81
 
82
82
  // Front Matter
83
- @page front-matter:first {
83
+ @page front-matter:first-of-group {
84
84
  @include blank-head-and-foot;
85
85
  }
86
86
 
87
- @include page-structure('front-matter', 'first', convert-position('first', $first-numbering-position), convert-position('first', $first-running-content-position));
87
+ @include page-structure('front-matter', 'first-of-group', convert-position('first', $first-numbering-position), convert-position('first', $first-running-content-position));
88
88
  @include page-structure('front-matter', 'left', convert-position('left', $numbering-position), convert-position('left', $running-content-position));
89
89
  @include page-structure('front-matter', 'right', convert-position('right', $numbering-position), convert-position('right', $running-content-position));
90
90
 
91
91
  // Introduction
92
- @page introduction:first {
92
+ @page introduction:first-of-group {
93
93
  @include blank-head-and-foot;
94
94
  }
95
95
 
96
- @include page-structure('introduction', 'first', convert-position('first', $first-numbering-position), convert-position('first', $first-running-content-position));
96
+ @include page-structure('introduction', 'first-of-group', convert-position('first', $first-numbering-position), convert-position('first', $first-running-content-position));
97
97
  @include page-structure('introduction', 'left', convert-position('left', $numbering-position), convert-position('left', $running-content-position));
98
98
  @include page-structure('introduction', 'right', convert-position('right', $numbering-position), convert-position('right', $running-content-position));
99
99
 
100
100
  // Post-introduction
101
- @page post-introduction:first {
101
+ @page post-introduction:first-of-group {
102
102
  @include blank-head-and-foot;
103
103
  }
104
104
 
105
- @include page-structure('post-introduction', 'first', convert-position('first', $first-numbering-position), convert-position('first', $first-running-content-position));
105
+ @include page-structure('post-introduction', 'first-of-group', convert-position('first', $first-numbering-position), convert-position('first', $first-running-content-position));
106
106
  @include page-structure('post-introduction', 'left', convert-position('left', $numbering-position), convert-position('left', $running-content-position));
107
107
  @include page-structure('post-introduction', 'right', convert-position('right', $numbering-position), convert-position('right', $running-content-position));
108
108
 
109
109
 
110
110
  // Parts
111
- @page part:first {
111
+ @page part:first-of-group {
112
112
  @include blank-head-and-foot;
113
113
  }
114
114
 
115
- @include page-structure('part', 'first', convert-position('first', $first-numbering-position), convert-position('first', $first-running-content-position));
115
+ @include page-structure('part', 'first-of-group', convert-position('first', $first-numbering-position), convert-position('first', $first-running-content-position));
116
116
  @include page-structure('part', 'left', convert-position('left', $numbering-position), convert-position('left', $running-content-position));
117
117
  @include page-structure('part', 'right', convert-position('right', $numbering-position), convert-position('right', $running-content-position));
118
118
 
119
119
  // Chapters
120
- @page chapter:first {
120
+ @page chapter:first-of-group {
121
121
  @include blank-head-and-foot;
122
122
  }
123
123
 
124
- @include page-structure('chapter', 'first', convert-position('first', $first-numbering-position), convert-position('first', $first-running-content-position));
124
+ @include page-structure('chapter', 'first-of-group', convert-position('first', $first-numbering-position), convert-position('first', $first-running-content-position));
125
125
  @include page-structure('chapter', 'left', convert-position('left', $numbering-position), convert-position('left', $running-content-position));
126
126
  @include page-structure('chapter', 'right', convert-position('right', $numbering-position), convert-position('right', $running-content-position));
127
127
 
128
128
  // Back Matter
129
- @page back-matter:first {
129
+ @page back-matter:first-of-group {
130
130
  @include blank-head-and-foot;
131
131
  }
132
132
 
133
- @include page-structure('back-matter', 'first', convert-position('first', $first-numbering-position), convert-position('first', $first-running-content-position));
133
+ @include page-structure('back-matter', 'first-of-group', convert-position('first', $first-numbering-position), convert-position('first', $first-running-content-position));
134
134
  @include page-structure('back-matter', 'left', convert-position('left', $numbering-position), convert-position('left', $running-content-position));
135
135
  @include page-structure('back-matter', 'right', convert-position('right', $numbering-position), convert-position('right', $running-content-position));
@@ -36,6 +36,16 @@
36
36
 
37
37
  @if $type == 'prince' {
38
38
  #toc {
39
+ ul {
40
+ /* stylelint-disable-next-line value-keyword-case */
41
+ -prince-pdf-tag-type: TOC;
42
+ }
43
+
44
+ li {
45
+ /* stylelint-disable-next-line value-keyword-case */
46
+ -prince-pdf-tag-type: TOCI;
47
+ }
48
+
39
49
  a::after {
40
50
  display: $toc-center-page-number-display;
41
51
  }
@@ -50,4 +60,4 @@
50
60
  display: $toc-center-chapter-number-display;
51
61
  }
52
62
  }
53
- }
63
+ }
@@ -252,10 +252,14 @@
252
252
  }
253
253
 
254
254
  ul {
255
+ /* stylelint-disable-next-line value-keyword-case */
256
+ -prince-pdf-tag-type: TOC;
255
257
  counter-reset: chapter;
256
258
  }
257
259
 
258
260
  li {
261
+ /* stylelint-disable-next-line value-keyword-case */
262
+ -prince-pdf-tag-type: TOCI;
259
263
  page-break-inside: avoid;
260
264
  position: relative;
261
265
  }
@@ -52,6 +52,16 @@
52
52
 
53
53
  @if $type == 'prince' {
54
54
  #toc {
55
+ ul {
56
+ /* stylelint-disable-next-line value-keyword-case */
57
+ -prince-pdf-tag-type: TOC;
58
+ }
59
+
60
+ li {
61
+ /* stylelint-disable-next-line value-keyword-case */
62
+ -prince-pdf-tag-type: TOCI;
63
+ }
64
+
55
65
  a::after {
56
66
  display: $toc-left-page-number-display;
57
67
  position: absolute;
@@ -755,6 +755,13 @@ $blockquote-border-left-style: none !default;
755
755
  /// @since 1.0.0
756
756
  $blockquote-border-left-color: initial !default;
757
757
 
758
+ /// Box decoration break behavior for elements that may span page breaks (textboxes, asides, blockquotes).
759
+ /// Set to `clone` to restore Prince 15 behavior where borders, padding, and backgrounds
760
+ /// are repeated on each page fragment. Prince 16+ defaults to `slice` per CSS spec.
761
+ /// @type String
762
+ /// @since 1.9.0
763
+ $box-decoration-break: clone !default;
764
+
758
765
  /// Top margin for `<ol>` elements.
759
766
  /// @type String | Map
760
767
  $ol-margin-top: 1em !default;
@@ -204,6 +204,12 @@ $endnote-ol-margin-top: 0.4em !default;
204
204
  /// @type String
205
205
  $endnote-ol-margin-left: 0 !default;
206
206
 
207
+ /// Left padding on ordered lists within endnotes on `<ol>` elements that are children of elements with a class of `endnotes`.
208
+ /// Required for correct list indentation in Prince 16+ which uses padding-based list indentation.
209
+ /// @type String
210
+ /// @since 1.9.0
211
+ $endnote-ol-padding-left: 0 !default;
212
+
207
213
  /// Font size on ordered lists within endnotes on `<ol>` elements that are children of elements with a class of `endnotes`.
208
214
  /// @type String
209
215
  $endnote-ol-font-size: 0.85em !default;
@@ -690,6 +696,12 @@ $textbox-ol-margin-top: 1em !default;
690
696
  /// @since 1.0.0
691
697
  $textbox-ol-margin-bottom: 0.75em !default;
692
698
 
699
+ /// Textbox left padding on `<ol>` elements that are children of elements with a class of `textbox`.
700
+ /// Required for correct list indentation in Prince 16+ which uses padding-based list indentation.
701
+ /// @type String
702
+ /// @since 1.9.0
703
+ $textbox-ol-padding-left: 1em !default;
704
+
693
705
  /// Textbox header top margin on `<ul>` elements that are children of elements with a class of `textbox`.
694
706
  /// @type String
695
707
  /// @since 1.0.0
@@ -700,6 +712,12 @@ $textbox-ul-margin-top: 1em !default;
700
712
  /// @since 1.0.0
701
713
  $textbox-ul-margin-bottom: 0.75em !default;
702
714
 
715
+ /// Textbox left padding on `<ul>` elements that are children of elements with a class of `textbox`.
716
+ /// Required for correct list indentation in Prince 16+ which uses padding-based list indentation.
717
+ /// @type String
718
+ /// @since 1.9.0
719
+ $textbox-ul-padding-left: 1em !default;
720
+
703
721
  /// Textbox header left margin on `<li>` elements that are children of elements with a class of `textbox`.
704
722
  /// @type String
705
723
  /// @since 1.0.0
package/package.json CHANGED
@@ -1,14 +1,15 @@
1
1
  {
2
2
  "name": "buckram",
3
- "version": "1.8.8",
3
+ "version": "1.9.1",
4
4
  "description": "Opinionated SCSS components for books (web, EPUB and PDF).",
5
5
  "scripts": {
6
6
  "build": "composer install && composer test",
7
- "diff": "npm run -s build && mocha",
7
+ "diff": "run-s build mocha",
8
8
  "docs": "cross-env NODE_ENV=development node_modules/sassdoc/bin/sassdoc assets/styles --config sassdoc.json",
9
- "lint": "npm run -s lint:styles",
10
- "lint:styles": "stylelint 'assets/styles/**/*.scss'",
11
- "test": "npm run -s lint && npm run -s build"
9
+ "lint": "pressbooks-build-tools lint:styles 'assets/styles/**/*.scss'",
10
+ "fix": "pressbooks-build-tools fix:styles 'assets/styles/**/*.scss'",
11
+ "mocha": "mocha",
12
+ "test": "run-s lint build"
12
13
  },
13
14
  "repository": {
14
15
  "type": "git",
@@ -26,22 +27,28 @@
26
27
  "devDependencies": {
27
28
  "chai": "^4.1.2",
28
29
  "mocha": "^10.0.0",
30
+ "npm-run-all2": "^8.0.4",
29
31
  "pixelmatch": "^5.2.1",
30
32
  "polyserve": "^0.27.15",
31
- "pressbooks-build-tools": "^4.0.0",
33
+ "pressbooks-build-tools": "^6.0.0",
32
34
  "puppeteer": "^23.6.0",
33
35
  "sassdoc": "^2.7.1",
34
36
  "type-detect": "^4.0.8"
35
37
  },
36
- "eslintConfig": {
37
- "extends": "./node_modules/pressbooks-build-tools/config/eslint.js"
38
- },
39
38
  "stylelint": {
40
- "extends": "./node_modules/pressbooks-build-tools/config/stylelint.js",
39
+ "extends": "pressbooks-build-tools/stylelint",
41
40
  "rules": {
42
41
  "no-descending-specificity": null,
43
42
  "no-duplicate-at-import-rules": null,
44
- "scss/no-global-function-names": null
43
+ "scss/no-global-function-names": null,
44
+ "selector-pseudo-class-no-unknown": [
45
+ true,
46
+ {
47
+ "ignorePseudoClasses": [
48
+ "first-of-group"
49
+ ]
50
+ }
51
+ ]
45
52
  }
46
53
  }
47
54
  }