Skip to content

Commit bf90323

Browse files
author
Ned Zimmerman
authored
Address errors in running content compilation (fix #310, fix #311) (#360)
1 parent ca33a3a commit bf90323

File tree

3 files changed

+27
-18
lines changed

3 files changed

+27
-18
lines changed

packages/buckram/assets/styles/components/structure/_mixins.scss

Lines changed: 25 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,8 @@
137137
}
138138

139139
// Running Content
140+
/// @param {string} $page-position - The page position.
141+
/// @param {string|map} $content-position - The running content position.
140142
@mixin runninghead($page-position, $content-position) {
141143
@each $page-type in
142144
'front-matter:#{$page-position}',
@@ -212,6 +214,9 @@
212214
}
213215
}
214216

217+
// Running Content
218+
/// @param {string} $page-position - The page position.
219+
/// @param {string|map} $content-position - The running content position.
215220
@mixin runningfoot($page-position, $content-position) {
216221
@each $page-type in
217222
'front-matter:#{$page-position}',
@@ -288,6 +293,10 @@
288293
}
289294

290295
// Page Structure
296+
/// @param {string} $page-type - The page type.
297+
/// @param {string} $page-position - The page position.
298+
/// @param {string|map} $numbering-position - The page numbering position.
299+
/// @param {string|map} $running-content-position - The running content position.
291300
@mixin page-structure($page-type, $page-position, $numbering-position, $running-content-position) {
292301
@if $numbering-position and $running-content-position {
293302
@if $numbering-position == $running-content-position {
@@ -324,10 +333,10 @@
324333
}
325334
@else {
326335
@page #{$page-type}:first:right {
327-
#{map-get($running-content-position, right)} {
328-
@if map-get($running-content-position, right) == '@bottom-left'
329-
or map-get($running-content-position, right) == '@bottom-left-corner'
330-
or map-get($running-content-position, right) == '@left-bottom' {
336+
#{if-map-get($running-content-position, right)} {
337+
@if if-map-get($running-content-position, right) == '@bottom-left'
338+
or if-map-get($running-content-position, right) == '@bottom-left-corner'
339+
or if-map-get($running-content-position, right) == '@left-bottom' {
331340
content: if-map-get($right-page-number, $page-type) $right-running-separator if-map-get($right-running-content, $page-type);
332341
}
333342

@@ -338,10 +347,10 @@
338347
}
339348

340349
@page #{$page-type}:first:left {
341-
#{map-get($running-content-position, left)} {
342-
@if map-get($running-content-position, left) == '@bottom-right'
343-
or map-get($running-content-position, left) == '@bottom-right-corner'
344-
or map-get($running-content-position, left) == '@right-bottom' {
350+
#{if-map-get($running-content-position, left)} {
351+
@if if-map-get($running-content-position, left) == '@bottom-right'
352+
or if-map-get($running-content-position, left) == '@bottom-right-corner'
353+
or if-map-get($running-content-position, left) == '@right-bottom' {
345354
content: if-map-get($right-running-content, $page-type) $right-running-separator if-map-get($right-page-number, $page-type);
346355
}
347356

@@ -379,19 +388,19 @@
379388
}
380389
@else {
381390
@page #{$page-type}:first:right {
382-
#{map-get($running-content-position, right)} {
391+
#{if-map-get($running-content-position, right)} {
383392
content: if-map-get($right-running-content, $page-type);
384393
}
385-
#{map-get($numbering-position, right)} {
394+
#{if-map-get($numbering-position, right)} {
386395
content: if-map-get($right-page-number, $page-type);
387396
}
388397
}
389398

390399
@page #{$page-type}:first:left {
391-
#{map-get($running-content-position, left)} {
400+
#{if-map-get($running-content-position, left)} {
392401
content: if-map-get($left-running-content, $page-type);
393402
}
394-
#{map-get($numbering-position, left)} {
403+
#{if-map-get($numbering-position, left)} {
395404
content: if-map-get($left-page-number, $page-type);
396405
}
397406
}
@@ -417,13 +426,13 @@
417426

418427
@else {
419428
@page #{$page-type}:first:right {
420-
#{map-get($numbering-position, right)} {
429+
#{if-map-get($numbering-position, right)} {
421430
content: if-map-get($right-page-number, $page-type);
422431
}
423432
}
424433

425434
@page #{$page-type}:first:left {
426-
#{map-get($numbering-position, left)} {
435+
#{if-map-get($numbering-position, left)} {
427436
content: if-map-get($left-page-number, $page-type);
428437
}
429438
}
@@ -447,13 +456,13 @@
447456

448457
@else {
449458
@page #{$page-type}:first:right {
450-
#{map-get($running-content-position, right)} {
459+
#{if-map-get($running-content-position, right)} {
451460
content: if-map-get($right-running-content, $page-type);
452461
}
453462
}
454463

455464
@page #{$page-type}:first:left {
456-
#{map-get($running-content-position, left)} {
465+
#{if-map-get($running-content-position, left)} {
457466
content: if-map-get($left-running-content, $page-type);
458467
}
459468
}

packages/buckram/assets/styles/variables/_structure.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ $numbering-position: 'top-outside' !default;
2424

2525
/// First page numbering position.
2626
/// @type Null | String
27-
// $first-numbering-position: 'null' !default;
27+
// $first-numbering-position: null !default;
2828
// $first-numbering-position: 'top-center' !default;
2929
$first-numbering-position: 'bottom-center' !default;
3030
// $first-numbering-position: 'bottom-inside' !default;

packages/buckram/package-lock.json

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)