diff --git a/extensions/pagetop-bootsier/build.rs b/extensions/pagetop-bootsier/build.rs index 47cb474..f2d0f79 100644 --- a/extensions/pagetop-bootsier/build.rs +++ b/extensions/pagetop-bootsier/build.rs @@ -4,12 +4,9 @@ use std::env; use std::path::Path; fn main() -> std::io::Result<()> { - StaticFilesBundle::from_scss( - "./static/bootstrap-5.3.3/bootstrap.scss", - "bootstrap.min.css", - ) - .with_name("bootsier") - .build()?; + StaticFilesBundle::from_scss("./static/bootstrap/bootstrap.scss", "bootstrap.min.css") + .with_name("bootsier") + .build()?; StaticFilesBundle::from_dir("./static/js", Some(bootstrap_js_files)) .with_name("bootsier_js") .build() diff --git a/extensions/pagetop-bootsier/src/lib.rs b/extensions/pagetop-bootsier/src/lib.rs index c413e8e..fecf127 100644 --- a/extensions/pagetop-bootsier/src/lib.rs +++ b/extensions/pagetop-bootsier/src/lib.rs @@ -86,7 +86,7 @@ use pagetop::prelude::*; pub type BootsierRegion = ThemeRegion; // Versión de la librería Bootstrap. -const BOOTSTRAP_VERSION: &str = "5.3.3"; +const BOOTSTRAP_VERSION: &str = "5.3.8"; /// Tema basado en [Bootstrap](https://getbootstrap.com/) para los componentes base de PageTop. /// diff --git a/extensions/pagetop-bootsier/static/bootstrap-5.3.3/mixins/_box-shadow.scss b/extensions/pagetop-bootsier/static/bootstrap-5.3.3/mixins/_box-shadow.scss deleted file mode 100644 index 4172541..0000000 --- a/extensions/pagetop-bootsier/static/bootstrap-5.3.3/mixins/_box-shadow.scss +++ /dev/null @@ -1,18 +0,0 @@ -@mixin box-shadow($shadow...) { - @if $enable-shadows { - $result: (); - - @each $value in $shadow { - @if $value != null { - $result: append($result, $value, "comma"); - } - @if $value == none and length($shadow) > 1 { - @warn "The keyword 'none' must be used as a single argument."; - } - } - - @if (length($result) > 0) { - box-shadow: $result; - } - } -} diff --git a/extensions/pagetop-bootsier/static/bootstrap-5.3.3/_accordion.scss b/extensions/pagetop-bootsier/static/bootstrap/_accordion.scss similarity index 97% rename from extensions/pagetop-bootsier/static/bootstrap-5.3.3/_accordion.scss rename to extensions/pagetop-bootsier/static/bootstrap/_accordion.scss index 17e5436..e9f267f 100644 --- a/extensions/pagetop-bootsier/static/bootstrap-5.3.3/_accordion.scss +++ b/extensions/pagetop-bootsier/static/bootstrap/_accordion.scss @@ -134,17 +134,12 @@ &:last-child { border-bottom: 0; } // stylelint-disable selector-max-class - > .accordion-header .accordion-button { - &, - &.collapsed { - @include border-radius(0); - } - } - // stylelint-enable selector-max-class - - > .accordion-collapse { + > .accordion-collapse, + > .accordion-header .accordion-button, + > .accordion-header .accordion-button.collapsed { @include border-radius(0); } + // stylelint-enable selector-max-class } } diff --git a/extensions/pagetop-bootsier/static/bootstrap-5.3.3/_alert.scss b/extensions/pagetop-bootsier/static/bootstrap/_alert.scss similarity index 100% rename from extensions/pagetop-bootsier/static/bootstrap-5.3.3/_alert.scss rename to extensions/pagetop-bootsier/static/bootstrap/_alert.scss diff --git a/extensions/pagetop-bootsier/static/bootstrap-5.3.3/_badge.scss b/extensions/pagetop-bootsier/static/bootstrap/_badge.scss similarity index 100% rename from extensions/pagetop-bootsier/static/bootstrap-5.3.3/_badge.scss rename to extensions/pagetop-bootsier/static/bootstrap/_badge.scss diff --git a/extensions/pagetop-bootsier/static/bootstrap-5.3.3/_breadcrumb.scss b/extensions/pagetop-bootsier/static/bootstrap/_breadcrumb.scss similarity index 100% rename from extensions/pagetop-bootsier/static/bootstrap-5.3.3/_breadcrumb.scss rename to extensions/pagetop-bootsier/static/bootstrap/_breadcrumb.scss diff --git a/extensions/pagetop-bootsier/static/bootstrap-5.3.3/_button-group.scss b/extensions/pagetop-bootsier/static/bootstrap/_button-group.scss similarity index 87% rename from extensions/pagetop-bootsier/static/bootstrap-5.3.3/_button-group.scss rename to extensions/pagetop-bootsier/static/bootstrap/_button-group.scss index 55ae3f6..78e1252 100644 --- a/extensions/pagetop-bootsier/static/bootstrap-5.3.3/_button-group.scss +++ b/extensions/pagetop-bootsier/static/bootstrap/_button-group.scss @@ -39,7 +39,7 @@ // Prevent double borders when buttons are next to each other > :not(.btn-check:first-child) + .btn, > .btn-group:not(:first-child) { - margin-left: calc(#{$btn-border-width} * -1); // stylelint-disable-line function-disallowed-list + margin-left: calc(-1 * #{$btn-border-width}); // stylelint-disable-line function-disallowed-list } // Reset rounded corners @@ -126,7 +126,7 @@ > .btn:not(:first-child), > .btn-group:not(:first-child) { - margin-top: calc(#{$btn-border-width} * -1); // stylelint-disable-line function-disallowed-list + margin-top: calc(-1 * #{$btn-border-width}); // stylelint-disable-line function-disallowed-list } // Reset rounded corners @@ -135,7 +135,12 @@ @include border-bottom-radius(0); } - > .btn ~ .btn, + // The top radius should be 0 if the button is: + // - the "third or more" child + // - the second child and the previous element isn't `.btn-check` (making it the first child visually) + // - part of a btn-group which isn't the first child + > .btn:nth-child(n + 3), + > :not(.btn-check) + .btn, > .btn-group:not(:first-child) > .btn { @include border-top-radius(0); } diff --git a/extensions/pagetop-bootsier/static/bootstrap-5.3.3/_buttons.scss b/extensions/pagetop-bootsier/static/bootstrap/_buttons.scss similarity index 100% rename from extensions/pagetop-bootsier/static/bootstrap-5.3.3/_buttons.scss rename to extensions/pagetop-bootsier/static/bootstrap/_buttons.scss diff --git a/extensions/pagetop-bootsier/static/bootstrap-5.3.3/_card.scss b/extensions/pagetop-bootsier/static/bootstrap/_card.scss similarity index 95% rename from extensions/pagetop-bootsier/static/bootstrap-5.3.3/_card.scss rename to extensions/pagetop-bootsier/static/bootstrap/_card.scss index d3535a9..dcebe6a 100644 --- a/extensions/pagetop-bootsier/static/bootstrap-5.3.3/_card.scss +++ b/extensions/pagetop-bootsier/static/bootstrap/_card.scss @@ -193,8 +193,7 @@ // The child selector allows nested `.card` within `.card-group` // to display properly. > .card { - // Flexbugs #4: https://github.com/philipwalton/flexbugs#flexbug-4 - flex: 1 0 0%; + flex: 1 0 0; margin-bottom: 0; + .card { @@ -207,13 +206,13 @@ &:not(:last-child) { @include border-end-radius(0); - .card-img-top, - .card-header { + > .card-img-top, + > .card-header { // stylelint-disable-next-line property-disallowed-list border-top-right-radius: 0; } - .card-img-bottom, - .card-footer { + > .card-img-bottom, + > .card-footer { // stylelint-disable-next-line property-disallowed-list border-bottom-right-radius: 0; } @@ -222,13 +221,13 @@ &:not(:first-child) { @include border-start-radius(0); - .card-img-top, - .card-header { + > .card-img-top, + > .card-header { // stylelint-disable-next-line property-disallowed-list border-top-left-radius: 0; } - .card-img-bottom, - .card-footer { + > .card-img-bottom, + > .card-footer { // stylelint-disable-next-line property-disallowed-list border-bottom-left-radius: 0; } diff --git a/extensions/pagetop-bootsier/static/bootstrap-5.3.3/_carousel.scss b/extensions/pagetop-bootsier/static/bootstrap/_carousel.scss similarity index 87% rename from extensions/pagetop-bootsier/static/bootstrap-5.3.3/_carousel.scss rename to extensions/pagetop-bootsier/static/bootstrap/_carousel.scss index 3a13522..5ebf6b1 100644 --- a/extensions/pagetop-bootsier/static/bootstrap-5.3.3/_carousel.scss +++ b/extensions/pagetop-bootsier/static/bootstrap/_carousel.scss @@ -99,6 +99,7 @@ color: $carousel-control-color; text-align: center; background: none; + filter: var(--#{$prefix}carousel-control-icon-filter); border: 0; opacity: $carousel-control-opacity; @include transition($carousel-control-transition); @@ -168,7 +169,7 @@ margin-left: $carousel-indicator-spacer; text-indent: -999px; cursor: pointer; - background-color: $carousel-indicator-active-bg; + background-color: var(--#{$prefix}carousel-indicator-active-bg); background-clip: padding-box; border: 0; // Use transparent borders to increase the hit area by 10px on top and bottom. @@ -195,42 +196,31 @@ left: (100% - $carousel-caption-width) * .5; padding-top: $carousel-caption-padding-y; padding-bottom: $carousel-caption-padding-y; - color: $carousel-caption-color; + color: var(--#{$prefix}carousel-caption-color); text-align: center; } // Dark mode carousel @mixin carousel-dark() { - .carousel-control-prev-icon, - .carousel-control-next-icon { - filter: $carousel-dark-control-icon-filter; - } - - .carousel-indicators [data-bs-target] { - background-color: $carousel-dark-indicator-active-bg; - } - - .carousel-caption { - color: $carousel-dark-caption-color; - } + --#{$prefix}carousel-indicator-active-bg: #{$carousel-indicator-active-bg-dark}; + --#{$prefix}carousel-caption-color: #{$carousel-caption-color-dark}; + --#{$prefix}carousel-control-icon-filter: #{$carousel-control-icon-filter-dark}; } .carousel-dark { @include carousel-dark(); } +:root, +[data-bs-theme="light"] { + --#{$prefix}carousel-indicator-active-bg: #{$carousel-indicator-active-bg}; + --#{$prefix}carousel-caption-color: #{$carousel-caption-color}; + --#{$prefix}carousel-control-icon-filter: #{$carousel-control-icon-filter}; +} + @if $enable-dark-mode { - @include color-mode(dark) { - @if $color-mode-type == "media-query" { - .carousel { - @include carousel-dark(); - } - } @else { - .carousel, - &.carousel { - @include carousel-dark(); - } - } + @include color-mode(dark, true) { + @include carousel-dark(); } } diff --git a/extensions/pagetop-bootsier/static/bootstrap-5.3.3/_close.scss b/extensions/pagetop-bootsier/static/bootstrap/_close.scss similarity index 87% rename from extensions/pagetop-bootsier/static/bootstrap-5.3.3/_close.scss rename to extensions/pagetop-bootsier/static/bootstrap/_close.scss index 4d6e73c..d53c96f 100644 --- a/extensions/pagetop-bootsier/static/bootstrap-5.3.3/_close.scss +++ b/extensions/pagetop-bootsier/static/bootstrap/_close.scss @@ -12,7 +12,6 @@ --#{$prefix}btn-close-focus-shadow: #{$btn-close-focus-shadow}; --#{$prefix}btn-close-focus-opacity: #{$btn-close-focus-opacity}; --#{$prefix}btn-close-disabled-opacity: #{$btn-close-disabled-opacity}; - --#{$prefix}btn-close-white-filter: #{$btn-close-white-filter}; // scss-docs-end close-css-vars box-sizing: content-box; @@ -21,6 +20,7 @@ padding: $btn-close-padding-y $btn-close-padding-x; color: var(--#{$prefix}btn-close-color); background: transparent var(--#{$prefix}btn-close-bg) center / $btn-close-width auto no-repeat; // include transparent for button elements + filter: var(--#{$prefix}btn-close-filter); border: 0; // for button elements @include border-radius(); opacity: var(--#{$prefix}btn-close-opacity); @@ -47,17 +47,20 @@ } @mixin btn-close-white() { - filter: var(--#{$prefix}btn-close-white-filter); + --#{$prefix}btn-close-filter: #{$btn-close-filter-dark}; } .btn-close-white { @include btn-close-white(); } +:root, +[data-bs-theme="light"] { + --#{$prefix}btn-close-filter: #{$btn-close-filter}; +} + @if $enable-dark-mode { - @include color-mode(dark) { - .btn-close { - @include btn-close-white(); - } + @include color-mode(dark, true) { + @include btn-close-white(); } } diff --git a/extensions/pagetop-bootsier/static/bootstrap-5.3.3/_containers.scss b/extensions/pagetop-bootsier/static/bootstrap/_containers.scss similarity index 100% rename from extensions/pagetop-bootsier/static/bootstrap-5.3.3/_containers.scss rename to extensions/pagetop-bootsier/static/bootstrap/_containers.scss diff --git a/extensions/pagetop-bootsier/static/bootstrap-5.3.3/_dropdown.scss b/extensions/pagetop-bootsier/static/bootstrap/_dropdown.scss similarity index 100% rename from extensions/pagetop-bootsier/static/bootstrap-5.3.3/_dropdown.scss rename to extensions/pagetop-bootsier/static/bootstrap/_dropdown.scss diff --git a/extensions/pagetop-bootsier/static/bootstrap-5.3.3/_forms.scss b/extensions/pagetop-bootsier/static/bootstrap/_forms.scss similarity index 100% rename from extensions/pagetop-bootsier/static/bootstrap-5.3.3/_forms.scss rename to extensions/pagetop-bootsier/static/bootstrap/_forms.scss diff --git a/extensions/pagetop-bootsier/static/bootstrap-5.3.3/_functions.scss b/extensions/pagetop-bootsier/static/bootstrap/_functions.scss similarity index 99% rename from extensions/pagetop-bootsier/static/bootstrap-5.3.3/_functions.scss rename to extensions/pagetop-bootsier/static/bootstrap/_functions.scss index 9029658..59d431a 100644 --- a/extensions/pagetop-bootsier/static/bootstrap-5.3.3/_functions.scss +++ b/extensions/pagetop-bootsier/static/bootstrap/_functions.scss @@ -157,7 +157,7 @@ $_luminance-list: .0008 .001 .0011 .0013 .0015 .0017 .002 .0022 .0025 .0027 .003 @each $color in $foregrounds { $contrast-ratio: contrast-ratio($background, $color); - @if $contrast-ratio > $min-contrast-ratio { + @if $contrast-ratio >= $min-contrast-ratio { @return $color; } @else if $contrast-ratio > $max-ratio { $max-ratio: $contrast-ratio; @@ -177,7 +177,7 @@ $_luminance-list: .0008 .001 .0011 .0013 .0015 .0017 .002 .0022 .0025 .0027 .003 @return if($l1 > $l2, divide($l1 + .05, $l2 + .05), divide($l2 + .05, $l1 + .05)); } -// Return WCAG2.1 relative luminance +// Return WCAG2.2 relative luminance // See https://www.w3.org/TR/WCAG/#dfn-relative-luminance // See https://www.w3.org/TR/WCAG/#dfn-contrast-ratio @function luminance($color) { diff --git a/extensions/pagetop-bootsier/static/bootstrap-5.3.3/_grid.scss b/extensions/pagetop-bootsier/static/bootstrap/_grid.scss similarity index 100% rename from extensions/pagetop-bootsier/static/bootstrap-5.3.3/_grid.scss rename to extensions/pagetop-bootsier/static/bootstrap/_grid.scss diff --git a/extensions/pagetop-bootsier/static/bootstrap-5.3.3/_helpers.scss b/extensions/pagetop-bootsier/static/bootstrap/_helpers.scss similarity index 100% rename from extensions/pagetop-bootsier/static/bootstrap-5.3.3/_helpers.scss rename to extensions/pagetop-bootsier/static/bootstrap/_helpers.scss diff --git a/extensions/pagetop-bootsier/static/bootstrap-5.3.3/_images.scss b/extensions/pagetop-bootsier/static/bootstrap/_images.scss similarity index 100% rename from extensions/pagetop-bootsier/static/bootstrap-5.3.3/_images.scss rename to extensions/pagetop-bootsier/static/bootstrap/_images.scss diff --git a/extensions/pagetop-bootsier/static/bootstrap-5.3.3/_list-group.scss b/extensions/pagetop-bootsier/static/bootstrap/_list-group.scss similarity index 93% rename from extensions/pagetop-bootsier/static/bootstrap-5.3.3/_list-group.scss rename to extensions/pagetop-bootsier/static/bootstrap/_list-group.scss index 455531e..3bdff67 100644 --- a/extensions/pagetop-bootsier/static/bootstrap-5.3.3/_list-group.scss +++ b/extensions/pagetop-bootsier/static/bootstrap/_list-group.scss @@ -43,31 +43,6 @@ } } -// Interactive list items -// -// Use anchor or button elements instead of `li`s or `div`s to create interactive -// list items. Includes an extra `.active` modifier class for selected items. - -.list-group-item-action { - width: 100%; // For `