|
137 | 137 | }
|
138 | 138 |
|
139 | 139 | // Running Content
|
| 140 | +/// @param {string} $page-position - The page position. |
| 141 | +/// @param {string|map} $content-position - The running content position. |
140 | 142 | @mixin runninghead($page-position, $content-position) {
|
141 | 143 | @each $page-type in
|
142 | 144 | 'front-matter:#{$page-position}',
|
|
212 | 214 | }
|
213 | 215 | }
|
214 | 216 |
|
| 217 | +// Running Content |
| 218 | +/// @param {string} $page-position - The page position. |
| 219 | +/// @param {string|map} $content-position - The running content position. |
215 | 220 | @mixin runningfoot($page-position, $content-position) {
|
216 | 221 | @each $page-type in
|
217 | 222 | 'front-matter:#{$page-position}',
|
|
288 | 293 | }
|
289 | 294 |
|
290 | 295 | // 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. |
291 | 300 | @mixin page-structure($page-type, $page-position, $numbering-position, $running-content-position) {
|
292 | 301 | @if $numbering-position and $running-content-position {
|
293 | 302 | @if $numbering-position == $running-content-position {
|
|
324 | 333 | }
|
325 | 334 | @else {
|
326 | 335 | @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' { |
331 | 340 | content: if-map-get($right-page-number, $page-type) $right-running-separator if-map-get($right-running-content, $page-type);
|
332 | 341 | }
|
333 | 342 |
|
|
338 | 347 | }
|
339 | 348 |
|
340 | 349 | @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' { |
345 | 354 | content: if-map-get($right-running-content, $page-type) $right-running-separator if-map-get($right-page-number, $page-type);
|
346 | 355 | }
|
347 | 356 |
|
|
379 | 388 | }
|
380 | 389 | @else {
|
381 | 390 | @page #{$page-type}:first:right {
|
382 |
| - #{map-get($running-content-position, right)} { |
| 391 | + #{if-map-get($running-content-position, right)} { |
383 | 392 | content: if-map-get($right-running-content, $page-type);
|
384 | 393 | }
|
385 |
| - #{map-get($numbering-position, right)} { |
| 394 | + #{if-map-get($numbering-position, right)} { |
386 | 395 | content: if-map-get($right-page-number, $page-type);
|
387 | 396 | }
|
388 | 397 | }
|
389 | 398 |
|
390 | 399 | @page #{$page-type}:first:left {
|
391 |
| - #{map-get($running-content-position, left)} { |
| 400 | + #{if-map-get($running-content-position, left)} { |
392 | 401 | content: if-map-get($left-running-content, $page-type);
|
393 | 402 | }
|
394 |
| - #{map-get($numbering-position, left)} { |
| 403 | + #{if-map-get($numbering-position, left)} { |
395 | 404 | content: if-map-get($left-page-number, $page-type);
|
396 | 405 | }
|
397 | 406 | }
|
|
417 | 426 |
|
418 | 427 | @else {
|
419 | 428 | @page #{$page-type}:first:right {
|
420 |
| - #{map-get($numbering-position, right)} { |
| 429 | + #{if-map-get($numbering-position, right)} { |
421 | 430 | content: if-map-get($right-page-number, $page-type);
|
422 | 431 | }
|
423 | 432 | }
|
424 | 433 |
|
425 | 434 | @page #{$page-type}:first:left {
|
426 |
| - #{map-get($numbering-position, left)} { |
| 435 | + #{if-map-get($numbering-position, left)} { |
427 | 436 | content: if-map-get($left-page-number, $page-type);
|
428 | 437 | }
|
429 | 438 | }
|
|
447 | 456 |
|
448 | 457 | @else {
|
449 | 458 | @page #{$page-type}:first:right {
|
450 |
| - #{map-get($running-content-position, right)} { |
| 459 | + #{if-map-get($running-content-position, right)} { |
451 | 460 | content: if-map-get($right-running-content, $page-type);
|
452 | 461 | }
|
453 | 462 | }
|
454 | 463 |
|
455 | 464 | @page #{$page-type}:first:left {
|
456 |
| - #{map-get($running-content-position, left)} { |
| 465 | + #{if-map-get($running-content-position, left)} { |
457 | 466 | content: if-map-get($left-running-content, $page-type);
|
458 | 467 | }
|
459 | 468 | }
|
|
0 commit comments