2020-11-02 20:36:51 +01:00
|
|
|
//
|
|
|
|
// Base styles
|
|
|
|
//
|
|
|
|
|
|
|
|
.accordion-button {
|
2020-11-03 21:56:24 +01:00
|
|
|
position: relative;
|
2020-11-02 20:36:51 +01:00
|
|
|
display: flex;
|
|
|
|
align-items: center;
|
|
|
|
width: 100%;
|
|
|
|
padding: $accordion-button-padding-y $accordion-button-padding-x;
|
|
|
|
@include font-size($font-size-base);
|
|
|
|
color: $accordion-button-color;
|
2021-02-03 20:44:48 +01:00
|
|
|
text-align: left; // Reset button style
|
2020-11-02 20:36:51 +01:00
|
|
|
background-color: $accordion-button-bg;
|
2021-03-17 06:16:03 +01:00
|
|
|
border: 0;
|
2020-11-02 20:36:51 +01:00
|
|
|
@include border-radius(0);
|
|
|
|
overflow-anchor: none;
|
2020-11-05 21:18:38 +01:00
|
|
|
@include transition($accordion-transition);
|
|
|
|
|
2020-11-02 20:36:51 +01:00
|
|
|
&:not(.collapsed) {
|
|
|
|
color: $accordion-button-active-color;
|
|
|
|
background-color: $accordion-button-active-bg;
|
2021-03-17 06:16:03 +01:00
|
|
|
box-shadow: inset 0 ($accordion-border-width * -1) 0 $accordion-border-color;
|
2020-11-02 20:36:51 +01:00
|
|
|
|
|
|
|
&::after {
|
|
|
|
background-image: escape-svg($accordion-button-active-icon);
|
|
|
|
transform: $accordion-icon-transform;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// Accordion icon
|
|
|
|
&::after {
|
|
|
|
flex-shrink: 0;
|
|
|
|
width: $accordion-icon-width;
|
|
|
|
height: $accordion-icon-width;
|
|
|
|
margin-left: auto;
|
|
|
|
content: "";
|
|
|
|
background-image: escape-svg($accordion-button-icon);
|
|
|
|
background-repeat: no-repeat;
|
|
|
|
background-size: $accordion-icon-width;
|
|
|
|
@include transition($accordion-icon-transition);
|
|
|
|
}
|
|
|
|
|
2020-11-03 21:56:24 +01:00
|
|
|
&:hover {
|
|
|
|
z-index: 2;
|
|
|
|
}
|
|
|
|
|
2020-11-02 20:36:51 +01:00
|
|
|
&:focus {
|
2020-11-03 21:56:24 +01:00
|
|
|
z-index: 3;
|
2020-11-05 21:18:38 +01:00
|
|
|
border-color: $accordion-button-focus-border-color;
|
2020-11-02 20:36:51 +01:00
|
|
|
outline: 0;
|
2020-11-05 21:18:38 +01:00
|
|
|
box-shadow: $accordion-button-focus-box-shadow;
|
2020-11-02 20:36:51 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
.accordion-header {
|
|
|
|
margin-bottom: 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
.accordion-item {
|
2021-03-17 06:16:03 +01:00
|
|
|
background-color: $accordion-bg;
|
|
|
|
border: $accordion-border-width solid $accordion-border-color;
|
|
|
|
|
2020-11-05 21:18:38 +01:00
|
|
|
&:first-of-type {
|
2021-03-17 06:16:03 +01:00
|
|
|
@include border-top-radius($accordion-border-radius);
|
|
|
|
|
2020-11-05 21:18:38 +01:00
|
|
|
.accordion-button {
|
2021-03-17 06:16:03 +01:00
|
|
|
@include border-top-radius($accordion-inner-border-radius);
|
2020-11-05 21:18:38 +01:00
|
|
|
}
|
|
|
|
}
|
2020-11-02 20:36:51 +01:00
|
|
|
|
2021-04-30 09:59:54 +02:00
|
|
|
&:not(:first-of-type) {
|
|
|
|
border-top: 0;
|
|
|
|
}
|
|
|
|
|
2021-03-17 06:16:03 +01:00
|
|
|
// Only set a border-radius on the last item if the accordion is collapsed
|
2020-11-02 20:36:51 +01:00
|
|
|
&:last-of-type {
|
2021-03-17 06:16:03 +01:00
|
|
|
@include border-bottom-radius($accordion-border-radius);
|
|
|
|
|
2020-11-02 20:36:51 +01:00
|
|
|
.accordion-button {
|
|
|
|
&.collapsed {
|
2021-03-17 06:16:03 +01:00
|
|
|
@include border-bottom-radius($accordion-inner-border-radius);
|
2020-11-02 20:36:51 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2020-11-05 21:18:38 +01:00
|
|
|
.accordion-collapse {
|
2020-11-02 20:36:51 +01:00
|
|
|
@include border-bottom-radius($accordion-border-radius);
|
|
|
|
}
|
|
|
|
}
|
2020-11-05 21:18:38 +01:00
|
|
|
}
|
2020-11-02 20:36:51 +01:00
|
|
|
|
|
|
|
.accordion-body {
|
|
|
|
padding: $accordion-body-padding-y $accordion-body-padding-x;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// Flush accordion items
|
|
|
|
//
|
|
|
|
// Remove borders and border-radius to keep accordion items edge-to-edge.
|
|
|
|
|
|
|
|
.accordion-flush {
|
2020-11-05 21:18:38 +01:00
|
|
|
.accordion-collapse {
|
2020-11-02 20:36:51 +01:00
|
|
|
border-width: 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
.accordion-item {
|
2021-03-22 21:01:08 +01:00
|
|
|
border-right: 0;
|
|
|
|
border-left: 0;
|
2021-03-17 06:16:03 +01:00
|
|
|
@include border-radius(0);
|
2020-11-02 20:36:51 +01:00
|
|
|
|
2021-03-22 21:01:08 +01:00
|
|
|
&:first-child { border-top: 0; }
|
|
|
|
&:last-child { border-bottom: 0; }
|
|
|
|
|
2021-03-17 06:16:03 +01:00
|
|
|
.accordion-button {
|
|
|
|
@include border-radius(0);
|
2020-11-02 20:36:51 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|