diff --git a/.bundlewatch.config.json b/.bundlewatch.config.json index a6b97a7a78..7871807982 100644 --- a/.bundlewatch.config.json +++ b/.bundlewatch.config.json @@ -30,7 +30,7 @@ }, { "path": "./dist/css/boosted.min.css", - "maxSize": "27.0 kB" + "maxSize": "27.1 kB" }, { "path": "./dist/js/boosted.bundle.js", diff --git a/scss/_accordion.scss b/scss/_accordion.scss index 27be4a37ec..8a8d7d5021 100644 --- a/scss/_accordion.scss +++ b/scss/_accordion.scss @@ -6,9 +6,8 @@ position: relative; display: flex; align-items: center; - width: add(100%, $accordion-button-padding-x * 2); + width: 100%; padding: $accordion-button-padding-y $accordion-button-padding-x; - margin: 0 -#{$accordion-button-padding-x}; // Boosted mod @include font-size($accordion-button-font-size); // Boosted mod font-weight: $accordion-button-font-weight; // Boosted mod line-height: $accordion-button-line-height; // Boosted mod @@ -114,3 +113,34 @@ letter-spacing: $accordion-button-letter-spacing-lg; } } + +// Boosted mod +.accordion-dark { + .accordion-button { + color: $accordion-dark-button-color; + background-color: $accordion-dark-button-bg; + + &:not(.collapsed) { + color: $accordion-dark-button-active-color; + } + + &:hover { + color: $accordion-dark-button-active-color; + } + } + + .accordion-header { + border: $accordion-border-width solid $accordion-dark-border-color; + border-width: $accordion-border-width 0 0; + } + + .accordion-item { + color: $accordion-dark-color; + background-color: $accordion-dark-bg; + + &:last-of-type { + border-bottom: $accordion-border-width solid $accordion-dark-border-color; + } + } +} +// End mod diff --git a/scss/_variables.scss b/scss/_variables.scss index e92c978c22..954e485f77 100644 --- a/scss/_variables.scss +++ b/scss/_variables.scss @@ -1404,25 +1404,34 @@ $card-footer-color: $gray-700 !default; // Boosted mod // Accordion // scss-docs-start accordion-variables -$accordion-padding-y: $spacer * .5 !default; -$accordion-padding-x: $spacer * .5 !default; +$accordion-padding-y: $spacer * .5 !default; // Boosted mod +$accordion-padding-x: 0 !default; // Boosted mod $accordion-color: $body-color !default; $accordion-bg: $body-bg !default; -$accordion-border-width: $border-width * .5 !default; -$accordion-border-color: $gray-500 !default; +$accordion-border-width: $border-width * .5 !default; // Boosted mod +$accordion-border-color: $gray-500 !default; // Boosted mod $accordion-border-radius: $border-radius !default; $accordion-inner-border-radius: subtract($accordion-border-radius, $accordion-border-width) !default; -$accordion-body-padding-y: $spacer !default; -$accordion-body-padding-x: $spacer !default; +$accordion-body-padding-y: $spacer !default; // Boosted mod +$accordion-body-padding-x: $spacer !default; // Boosted mod $accordion-button-padding-y: $accordion-padding-y !default; $accordion-button-padding-x: $accordion-padding-x !default; $accordion-button-color: $accordion-color !default; $accordion-button-bg: $accordion-bg !default; $accordion-transition: $btn-transition, border-radius .15s ease !default; -$accordion-button-active-bg: null !default; -$accordion-button-active-color: $accessible-orange !default; +$accordion-button-active-bg: null !default; // Boosted mod +$accordion-button-active-color: $accessible-orange !default; // Boosted mod + +// Boosted mod: dark variant +$accordion-dark-color: $white !default; +$accordion-dark-bg: $black !default; +$accordion-dark-border-color: $gray-700 !default; +$accordion-dark-button-color: $accordion-dark-color !default; +$accordion-dark-button-bg: $accordion-dark-bg !default; +$accordion-dark-button-active-color: $brand-orange !default; +// End mod // Boosted mod: no $accordion-button-focus-* diff --git a/site/content/docs/5.1/components/accordion.md b/site/content/docs/5.1/components/accordion.md index c0a0b73b4e..e14107a6f6 100644 --- a/site/content/docs/5.1/components/accordion.md +++ b/site/content/docs/5.1/components/accordion.md @@ -198,6 +198,51 @@ Omit the `data-bs-parent` attribute on each `.accordion-collapse` to make accord {{< /example >}} +### Dark variant + +Accordions come with a dark variant: `.accordion-dark`. + +{{< example class="bg-dark" >}} +
+
+

+ +

+
+
+ This is the first item's accordion body. It is shown by default, until the collapse plugin adds the appropriate classes that we use to style each element. These classes control the overall appearance, as well as the showing and hiding via CSS transitions. You can modify any of this with custom CSS or overriding our default variables. It's also worth noting that just about any HTML can go within the .accordion-body, though the transition does limit overflow. +
+
+
+
+

+ +

+
+
+ This is the second item's accordion body. It is hidden by default, until the collapse plugin adds the appropriate classes that we use to style each element. These classes control the overall appearance, as well as the showing and hiding via CSS transitions. You can modify any of this with custom CSS or overriding our default variables. It's also worth noting that just about any HTML can go within the .accordion-body, though the transition does limit overflow. +
+
+
+
+

+ +

+
+
+ This is the third item's accordion body. It is hidden by default, until the collapse plugin adds the appropriate classes that we use to style each element. These classes control the overall appearance, as well as the showing and hiding via CSS transitions. You can modify any of this with custom CSS or overriding our default variables. It's also worth noting that just about any HTML can go within the .accordion-body, though the transition does limit overflow. +
+
+
+
+{{< /example >}} + ## Accessibility Please read the [collapse accessibility section]({{< docsref "/components/collapse#accessibility" >}}) for more information.