Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/twbs/bootstrap.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartijn Cuppens <martijn.cuppens@gmail.com>2020-11-05 23:18:38 +0300
committerXhmikosR <xhmikosr@gmail.com>2020-11-06 15:49:41 +0300
commit4c1f807142d4ddd6b63ea56b148ec20a5ae194bc (patch)
tree549e35b11bb6f24e7230f08078cb4a5474c384af
parentd6a72c4e1bb1dafdb21e759e42c2e6aa574ade74 (diff)
Fix missing border & add transitions
-rw-r--r--scss/_accordion.scss47
-rw-r--r--scss/_variables.scss4
-rw-r--r--site/content/docs/5.0/components/accordion.md12
3 files changed, 32 insertions, 31 deletions
diff --git a/scss/_accordion.scss b/scss/_accordion.scss
index 479aad1cc5..a68aaa70e3 100644
--- a/scss/_accordion.scss
+++ b/scss/_accordion.scss
@@ -11,10 +11,14 @@
@include font-size($font-size-base);
color: $accordion-button-color;
background-color: $accordion-button-bg;
- border: solid $accordion-border-color;
- border-width: $accordion-border-width $accordion-border-width 0;
+ border: $accordion-border-width solid $accordion-border-color;
@include border-radius(0);
overflow-anchor: none;
+ @include transition($accordion-transition);
+
+ &.collapsed {
+ border-bottom-width: 0;
+ }
&:not(.collapsed) {
color: $accordion-button-active-color;
@@ -45,8 +49,9 @@
&:focus {
z-index: 3;
+ border-color: $accordion-button-focus-border-color;
outline: 0;
- box-shadow: $btn-focus-box-shadow;
+ box-shadow: $accordion-button-focus-box-shadow;
}
}
@@ -55,35 +60,35 @@
}
.accordion-item {
- @include border-radius($accordion-border-radius);
+ &:first-of-type {
+ .accordion-button {
+ @include border-top-radius($accordion-border-radius);
+ }
+ }
&:last-of-type {
.accordion-button {
- border-bottom-width: $accordion-border-width;
-
// Only set a border-radius on the last item if the accordion is collapsed
&.collapsed {
+ border-bottom-width: $accordion-border-width;
@include border-bottom-radius($accordion-border-radius);
}
}
- .accordion-body {
- border-width: 0 $accordion-border-width $accordion-border-width;
+ .accordion-collapse {
+ border-bottom-width: $accordion-border-width;
@include border-bottom-radius($accordion-border-radius);
}
}
+}
- &:first-of-type {
- .accordion-button {
- @include border-top-radius($accordion-border-radius);
- }
- }
+.accordion-collapse {
+ border: solid $accordion-border-color;
+ border-width: 0 $accordion-border-width;
}
.accordion-body {
padding: $accordion-body-padding-y $accordion-body-padding-x;
- border: solid $accordion-border-color;
- border-width: $accordion-border-width $accordion-border-width 0;
}
@@ -98,15 +103,11 @@
@include border-radius(0);
}
- .accordion-body {
+ .accordion-collapse {
border-width: 0;
}
.accordion-item {
- border-right-width: 0;
- border-left-width: 0;
- @include border-radius(0);
-
&:first-of-type {
.accordion-button {
border-top-width: 0;
@@ -115,14 +116,10 @@
}
&:last-of-type {
- .accordion-button {
+ .accordion-button.collapsed {
border-bottom-width: 0;
@include border-bottom-radius(0);
}
-
- .accordion-body {
- border-width: 0;
- }
}
}
}
diff --git a/scss/_variables.scss b/scss/_variables.scss
index 6c5a070f26..7773ebaf16 100644
--- a/scss/_variables.scss
+++ b/scss/_variables.scss
@@ -1030,9 +1030,13 @@ $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: tint-color($component-active-bg, 90%) !default;
$accordion-button-active-color: $primary !default;
+$accordion-button-focus-border-color: $input-focus-border-color !default;
+$accordion-button-focus-box-shadow: $btn-focus-box-shadow !default;
+
$accordion-icon-width: 1.25rem !default;
$accordion-icon-color: $accordion-color !default;
$accordion-icon-active-color: $accordion-button-active-color !default;
diff --git a/site/content/docs/5.0/components/accordion.md b/site/content/docs/5.0/components/accordion.md
index 9844cf868c..1f08a79115 100644
--- a/site/content/docs/5.0/components/accordion.md
+++ b/site/content/docs/5.0/components/accordion.md
@@ -29,7 +29,7 @@ Click the accordions below to expand/collapse the accordion content.
Accordion Item #1
</button>
</h2>
- <div id="collapseOne" class="collapse show" aria-labelledby="headingOne" data-parent="#accordionExample">
+ <div id="collapseOne" class="accordion-collapse collapse show" aria-labelledby="headingOne" data-parent="#accordionExample">
<div class="accordion-body">
<strong>This is the first item's accordion body.</strong> 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 <code>.accordion-body</code>, though the transition does limit overflow.
</div>
@@ -41,7 +41,7 @@ Click the accordions below to expand/collapse the accordion content.
Accordion Item #2
</button>
</h2>
- <div id="collapseTwo" class="collapse" aria-labelledby="headingTwo" data-parent="#accordionExample">
+ <div id="collapseTwo" class="accordion-collapse collapse" aria-labelledby="headingTwo" data-parent="#accordionExample">
<div class="accordion-body">
<strong>This is the second item's accordion body.</strong> 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 <code>.accordion-body</code>, though the transition does limit overflow.
</div>
@@ -53,7 +53,7 @@ Click the accordions below to expand/collapse the accordion content.
Accordion Item #3
</button>
</h2>
- <div id="collapseThree" class="collapse" aria-labelledby="headingThree" data-parent="#accordionExample">
+ <div id="collapseThree" class="accordion-collapse collapse" aria-labelledby="headingThree" data-parent="#accordionExample">
<div class="accordion-body">
<strong>This is the third item's accordion body.</strong> 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 <code>.accordion-body</code>, though the transition does limit overflow.
</div>
@@ -74,7 +74,7 @@ Add `.accordion-flush` to remove the default `background-color`, some borders, a
Accordion Item #1
</button>
</h2>
- <div id="flush-collapseOne" class="collapse" aria-labelledby="flush-headingOne" data-parent="#accordionFlushExample">
+ <div id="flush-collapseOne" class="accordion-collapse collapse" aria-labelledby="flush-headingOne" data-parent="#accordionFlushExample">
<div class="accordion-body">Anim pariatur cliche reprehenderit, enim eiusmod high life accusamus terry richardson ad squid. 3 wolf moon officia aute, non cupidatat skateboard dolor brunch. Food truck quinoa nesciunt laborum eiusmod. Brunch 3 wolf moon tempor, sunt aliqua put a bird on it squid single-origin coffee nulla assumenda shoreditch et. Nihil anim keffiyeh helvetica, craft beer labore wes anderson cred nesciunt sapiente ea proident. Ad vegan excepteur butcher vice lomo. Leggings occaecat craft beer farm-to-table, raw denim aesthetic synth nesciunt you probably haven't heard of them accusamus labore sustainable VHS.</div>
</div>
</div>
@@ -84,7 +84,7 @@ Add `.accordion-flush` to remove the default `background-color`, some borders, a
Accordion Item #2
</button>
</h2>
- <div id="flush-collapseTwo" class="collapse" aria-labelledby="flush-headingTwo" data-parent="#accordionFlushExample">
+ <div id="flush-collapseTwo" class="accordion-collapse collapse" aria-labelledby="flush-headingTwo" data-parent="#accordionFlushExample">
<div class="accordion-body">Anim pariatur cliche reprehenderit, enim eiusmod high life accusamus terry richardson ad squid. 3 wolf moon officia aute, non cupidatat skateboard dolor brunch. Food truck quinoa nesciunt laborum eiusmod. Brunch 3 wolf moon tempor, sunt aliqua put a bird on it squid single-origin coffee nulla assumenda shoreditch et. Nihil anim keffiyeh helvetica, craft beer labore wes anderson cred nesciunt sapiente ea proident. Ad vegan excepteur butcher vice lomo. Leggings occaecat craft beer farm-to-table, raw denim aesthetic synth nesciunt you probably haven't heard of them accusamus labore sustainable VHS.</div>
</div>
</div>
@@ -94,7 +94,7 @@ Add `.accordion-flush` to remove the default `background-color`, some borders, a
Accordion Item #3
</button>
</h2>
- <div id="flush-collapseThree" class="collapse" aria-labelledby="flush-headingThree" data-parent="#accordionFlushExample">
+ <div id="flush-collapseThree" class="accordion-collapse collapse" aria-labelledby="flush-headingThree" data-parent="#accordionFlushExample">
<div class="accordion-body">Anim pariatur cliche reprehenderit, enim eiusmod high life accusamus terry richardson ad squid. 3 wolf moon officia aute, non cupidatat skateboard dolor brunch. Food truck quinoa nesciunt laborum eiusmod. Brunch 3 wolf moon tempor, sunt aliqua put a bird on it squid single-origin coffee nulla assumenda shoreditch et. Nihil anim keffiyeh helvetica, craft beer labore wes anderson cred nesciunt sapiente ea proident. Ad vegan excepteur butcher vice lomo. Leggings occaecat craft beer farm-to-table, raw denim aesthetic synth nesciunt you probably haven't heard of them accusamus labore sustainable VHS.</div>
</div>
</div>