1
0
Fork 0
mirror of https://github.com/twbs/bootstrap.git synced 2022-11-09 12:25:43 -05:00

Fix missing border & add transitions

This commit is contained in:
Martijn Cuppens 2020-11-05 21:18:38 +01:00 committed by XhmikosR
parent d6a72c4e1b
commit 4c1f807142
3 changed files with 40 additions and 39 deletions

View file

@ -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);
&: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 {
@include border-bottom-radius($accordion-border-radius);
}
}
.accordion-body {
border-width: 0 $accordion-border-width $accordion-border-width;
@include border-bottom-radius($accordion-border-radius);
}
}
&:first-of-type {
.accordion-button {
@include border-top-radius($accordion-border-radius);
}
}
&:last-of-type {
.accordion-button {
// 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-collapse {
border-bottom-width: $accordion-border-width;
@include border-bottom-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;
}
}
}
}

View file

@ -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;

View file

@ -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>