diff --git a/assets/styles/components/structure/_mixins.scss b/assets/styles/components/structure/_mixins.scss index 4e27cf6..1b50d68 100644 --- a/assets/styles/components/structure/_mixins.scss +++ b/assets/styles/components/structure/_mixins.scss @@ -16,7 +16,7 @@ @page #{$page-type} { @if $page-position == 'first:left' { @if if-map-get($content-position, left) { - #{if-map-get($content-position, left)} { + @include position(if-map-get($content-position, left)) { @if head-or-foot($content-position) == 'head' { padding-top: $runninghead-padding-top; } @else if head-or-foot($content-position) == 'foot' { @@ -28,7 +28,7 @@ } } @else if $page-position == 'first:right' { @if if-map-get($content-position, right) { - #{if-map-get($content-position, right)} { + @include position(if-map-get($content-position, right)) { @if head-or-foot($content-position) == 'head' { padding-top: $runninghead-padding-top; } @else if head-or-foot($content-position) == 'foot' { @@ -39,7 +39,7 @@ } } } @else { - #{$content-position} { + @include position($content-position) { @if head-or-foot($content-position) == 'head' { padding-top: $runninghead-padding-top; } @else if head-or-foot($content-position) == 'foot' { @@ -61,7 +61,7 @@ @page #{$page-type} { @if $page-position == 'first:left' { @if if-map-get($content-position, left) { - #{if-map-get($content-position, left)} { + @include position(if-map-get($content-position, left)) { @if head-or-foot($content-position) == 'head' { padding-top: $runninghead-padding-top; } @else if head-or-foot($content-position) == 'foot' { @@ -73,7 +73,7 @@ } } @else if $page-position == 'first:right' { @if if-map-get($content-position, right) { - #{if-map-get($content-position, right)} { + @include position(if-map-get($content-position, right)) { @if head-or-foot($content-position) == 'head' { padding-top: $runninghead-padding-top; } @else if head-or-foot($content-position) == 'foot' { @@ -84,7 +84,7 @@ } } } @else { - #{$content-position} { + @include position($content-position) { @if head-or-foot($content-position) == 'head' { padding-top: $runninghead-padding-top; } @else if head-or-foot($content-position) == 'foot' { @@ -118,6 +118,104 @@ color: if-map-get($page-number-color, $type); } +@mixin position($content-position) { + @if $content-position == '@bottom-center' { + @bottom-center { + @content; + } + } + + @if $content-position == '@bottom-right-corner' { + @bottom-right-corner { + @content; + } + } + + @if $content-position == '@left-middle' { + @left-middle { + @content; + } + } + + @if $content-position == '@right-middle' { + @right-middle { + @content; + } + } + + @if $content-position == '@top-left-corner' { + @top-left-corner { + @content; + } + } + + @if $content-position == '@top-right' { + @top-right { + @content; + } + } + + @if $content-position == '@bottom-left-corner' { + @bottom-left-corner { + @content; + } + } + + @if $content-position == '@bottom-right' { + @bottom-right { + @content; + } + } + + @if $content-position == '@left-top' { + @left-top { + @content; + } + } + + @if $content-position == '@right-top' { + @right-top { + @content; + } + } + + @if $content-position == '@top-left' { + @top-left { + @content; + } + } + + @if $content-position == '@bottom-left' { + @bottom-left { + @content; + } + } + + @if $content-position == '@left-bottom' { + @left-bottom { + @content; + } + } + + @if $content-position == '@right-bottom' { + @right-bottom { + @content; + } + } + + @if $content-position == '@top-center' { + @top-center { + @content; + } + } + + @if $content-position == '@top-right-corner' { + @top-right-corner { + @content; + } + } +} + // Running Content /// @param {string} $page-position - The page position. /// @param {string|map} $content-position - The running content position. @@ -132,7 +230,7 @@ @page #{$page-type} { @if $page-position == 'first:left' { @if if-map-get($content-position, left) { - #{if-map-get($content-position, left)} { + @include position(if-map-get($content-position, left)) { padding-top: $runninghead-padding-top; font-family: $runninghead-left-font-family; font-size: $runninghead-left-font-size; @@ -147,7 +245,7 @@ } } @else if $page-position == 'first:right' { @if if-map-get($content-position, right) { - #{if-map-get($content-position, right)} { + @include position(if-map-get($content-position, right)) { padding-top: $runninghead-padding-top; font-family: $runninghead-right-font-family; font-size: $runninghead-right-font-size; @@ -161,7 +259,7 @@ } } } @else { - #{$content-position} { + @include position($content-position) { padding-top: $runninghead-padding-top; @if $page-position == 'left' { @@ -205,7 +303,7 @@ @page #{$page-type} { @if $page-position == 'first:left' { @if if-map-get($content-position, left) { - #{if-map-get($content-position, left)} { + @include position(if-map-get($content-position, left)) { padding-bottom: $runningfoot-padding-bottom; font-family: $runningfoot-left-font-family; font-size: $runningfoot-left-font-size; @@ -220,7 +318,7 @@ } } @else if $page-position == 'first:right' { @if if-map-get($content-position, right) { - #{if-map-get($content-position, right)} { + @include position(if-map-get($content-position, right)) { padding-bottom: $runningfoot-padding-bottom; font-family: $runningfoot-right-font-family; font-size: $runningfoot-right-font-size; @@ -234,7 +332,7 @@ } } } @else { - #{$content-position} { + @include position($content-position) { padding-bottom: $runningfoot-padding-bottom; @if $page-position == 'left' { @@ -274,7 +372,7 @@ @if $numbering-position == $running-content-position { @if $page-position != 'first' { @page #{$page-type}:#{$page-position} { - #{$running-content-position} { + @include position($running-content-position) { @if $page-position == 'left' { @if $running-content-position == '@top-right' or $running-content-position == '@top-right-corner' @@ -298,7 +396,7 @@ } } @else { @page #{$page-type}:first:right { - #{if-map-get($running-content-position, right)} { + @include position(if-map-get($running-content-position, right)) { @if if-map-get($running-content-position, right) == '@bottom-left' or if-map-get($running-content-position, right) == '@bottom-left-corner' or if-map-get($running-content-position, right) == '@left-bottom' { @@ -310,7 +408,7 @@ } @page #{$page-type}:first:left { - #{if-map-get($running-content-position, left)} { + @include position(if-map-get($running-content-position, left)) { @if if-map-get($running-content-position, left) == '@bottom-right' or if-map-get($running-content-position, left) == '@bottom-right-corner' or if-map-get($running-content-position, left) == '@right-bottom' { @@ -324,7 +422,7 @@ } @else { @if $page-position != 'first' { @page #{$page-type}:#{$page-position} { - #{$running-content-position} { + @include position($running-content-position) { @if $page-position == 'left' { content: if-map-get($left-running-content, $page-type); } @else if $page-position == 'right' { @@ -332,7 +430,7 @@ } } - #{$numbering-position} { + @include position($numbering-position) { @if $page-position == 'left' { content: if-map-get($left-page-number, $page-type); } @else if $page-position == 'right' { @@ -343,19 +441,19 @@ } } @else { @page #{$page-type}:first:right { - #{if-map-get($running-content-position, right)} { + @include position(if-map-get($running-content-position, right)) { content: if-map-get($right-running-content, $page-type); } - #{if-map-get($numbering-position, right)} { + @include position(if-map-get($numbering-position, right)) { content: if-map-get($right-page-number, $page-type); } } @page #{$page-type}:first:left { - #{if-map-get($running-content-position, left)} { + @include position(if-map-get($running-content-position, left)) { content: if-map-get($left-running-content, $page-type); } - #{if-map-get($numbering-position, left)} { + @include position(if-map-get($numbering-position, left)) { content: if-map-get($left-page-number, $page-type); } } @@ -365,7 +463,7 @@ @if $numbering-position { @if $page-position != 'first' { @page #{$page-type}:#{$page-position} { - #{$numbering-position} { + @include position($numbering-position) { @if $page-position == 'left' { content: if-map-get($left-page-number, $page-type); } @else if $page-position == 'right' { @@ -375,13 +473,13 @@ } } @else { @page #{$page-type}:first:right { - #{if-map-get($numbering-position, right)} { + @include position(if-map-get($numbering-position, right)) { content: if-map-get($right-page-number, $page-type); } } @page #{$page-type}:first:left { - #{if-map-get($numbering-position, left)} { + @include position(if-map-get($numbering-position, left)) { content: if-map-get($left-page-number, $page-type); } } @@ -391,7 +489,7 @@ @if $running-content-position { @if $page-position != 'first' { @page #{$page-type}:#{$page-position} { - #{$running-content-position} { + @include position($running-content-position) { @if $page-position == 'left' { content: if-map-get($left-running-content, $page-type); } @else if $page-position == 'right' { @@ -401,13 +499,13 @@ } } @else { @page #{$page-type}:first:right { - #{if-map-get($running-content-position, right)} { + @include position(if-map-get($running-content-position, right)) { content: if-map-get($right-running-content, $page-type); } } @page #{$page-type}:first:left { - #{if-map-get($running-content-position, left)} { + @include position(if-map-get($running-content-position, left)) { content: if-map-get($left-running-content, $page-type); } } diff --git a/composer.json b/composer.json index bf1c7d0..206f831 100644 --- a/composer.json +++ b/composer.json @@ -12,6 +12,6 @@ ] }, "require-dev": { - "scssphp/scssphp": "~1.1" + "scssphp/scssphp": "^1.11" } } diff --git a/composer.lock b/composer.lock index d693784..2a8d961 100644 --- a/composer.lock +++ b/composer.lock @@ -4,21 +4,21 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "0e5ad88ba90ffa439c58828671887da6", + "content-hash": "fc76f0dba56bfdda826f4f2d5ce816e8", "packages": [], "packages-dev": [ { "name": "scssphp/scssphp", - "version": "1.1.1", + "version": "v1.11.0", "source": { "type": "git", "url": "https://github.com/scssphp/scssphp.git", - "reference": "824e4cec10b2bfa88eec5dac23991cb9106622c1" + "reference": "33749d12c2569bb24071f94e9af828662dabb068" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/scssphp/scssphp/zipball/824e4cec10b2bfa88eec5dac23991cb9106622c1", - "reference": "824e4cec10b2bfa88eec5dac23991cb9106622c1", + "url": "https://api.github.com/repos/scssphp/scssphp/zipball/33749d12c2569bb24071f94e9af828662dabb068", + "reference": "33749d12c2569bb24071f94e9af828662dabb068", "shasum": "" }, "require": { @@ -27,15 +27,30 @@ "php": ">=5.6.0" }, "require-dev": { - "phpunit/phpunit": "^5.7 || ^6.5 || ^7.5 || ^8.3", + "bamarni/composer-bin-plugin": "^1.4", + "phpunit/phpunit": "^5.7 || ^6.5 || ^7.5 || ^8.3 || ^9.4", + "sass/sass-spec": "*", "squizlabs/php_codesniffer": "~3.5", - "twbs/bootstrap": "~4.3", + "symfony/phpunit-bridge": "^5.1", + "thoughtbot/bourbon": "^7.0", + "twbs/bootstrap": "~5.0", + "twbs/bootstrap4": "4.6.1", "zurb/foundation": "~6.5" }, + "suggest": { + "ext-iconv": "Can be used as fallback when ext-mbstring is not available", + "ext-mbstring": "For best performance, mbstring should be installed as it is faster than ext-iconv" + }, "bin": [ "bin/pscss" ], "type": "library", + "extra": { + "bamarni-bin": { + "forward-command": false, + "bin-links": false + } + }, "autoload": { "psr-4": { "ScssPhp\\ScssPhp\\": "src/" @@ -68,9 +83,9 @@ ], "support": { "issues": "https://github.com/scssphp/scssphp/issues", - "source": "https://github.com/scssphp/scssphp/tree/1.1.1" + "source": "https://github.com/scssphp/scssphp/tree/v1.11.0" }, - "time": "2020-06-04T17:30:40+00:00" + "time": "2022-09-02T21:24:55+00:00" } ], "aliases": [], @@ -80,5 +95,5 @@ "prefer-lowest": false, "platform": [], "platform-dev": [], - "plugin-api-version": "2.3.0" + "plugin-api-version": "2.2.0" }