2020-11-02 20:36:51 +01:00
|
|
|
//
|
|
|
|
// Base styles
|
|
|
|
//
|
|
|
|
|
2022-03-29 00:05:37 +02:00
|
|
|
.accordion {
|
|
|
|
// scss-docs-start accordion-css-vars
|
2022-08-17 09:57:24 +02:00
|
|
|
--#{$prefix}accordion-color: #{$accordion-color};
|
2022-03-29 00:05:37 +02:00
|
|
|
--#{$prefix}accordion-bg: #{$accordion-bg};
|
2022-04-12 00:33:18 +02:00
|
|
|
--#{$prefix}accordion-transition: #{$accordion-transition};
|
2022-03-29 00:05:37 +02:00
|
|
|
--#{$prefix}accordion-border-color: #{$accordion-border-color};
|
|
|
|
--#{$prefix}accordion-border-width: #{$accordion-border-width};
|
|
|
|
--#{$prefix}accordion-border-radius: #{$accordion-border-radius};
|
2022-04-12 00:33:18 +02:00
|
|
|
--#{$prefix}accordion-inner-border-radius: #{$accordion-inner-border-radius};
|
2022-03-29 00:05:37 +02:00
|
|
|
--#{$prefix}accordion-btn-padding-x: #{$accordion-button-padding-x};
|
|
|
|
--#{$prefix}accordion-btn-padding-y: #{$accordion-button-padding-y};
|
2022-09-06 15:34:28 +02:00
|
|
|
--#{$prefix}accordion-btn-color: #{$accordion-button-color};
|
2022-04-12 00:33:18 +02:00
|
|
|
--#{$prefix}accordion-btn-bg: #{$accordion-button-bg};
|
|
|
|
--#{$prefix}accordion-btn-icon: #{escape-svg($accordion-button-icon)};
|
|
|
|
--#{$prefix}accordion-btn-icon-width: #{$accordion-icon-width};
|
|
|
|
--#{$prefix}accordion-btn-icon-transform: #{$accordion-icon-transform};
|
|
|
|
--#{$prefix}accordion-btn-icon-transition: #{$accordion-icon-transition};
|
|
|
|
--#{$prefix}accordion-btn-active-icon: #{escape-svg($accordion-button-active-icon)};
|
|
|
|
--#{$prefix}accordion-btn-focus-border-color: #{$accordion-button-focus-border-color};
|
|
|
|
--#{$prefix}accordion-btn-focus-box-shadow: #{$accordion-button-focus-box-shadow};
|
2022-03-29 00:05:37 +02:00
|
|
|
--#{$prefix}accordion-body-padding-x: #{$accordion-body-padding-x};
|
|
|
|
--#{$prefix}accordion-body-padding-y: #{$accordion-body-padding-y};
|
|
|
|
--#{$prefix}accordion-active-color: #{$accordion-button-active-color};
|
|
|
|
--#{$prefix}accordion-active-bg: #{$accordion-button-active-bg};
|
|
|
|
// scss-docs-end accordion-css-vars
|
|
|
|
}
|
|
|
|
|
2020-11-02 20:36:51 +01:00
|
|
|
.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%;
|
2022-03-29 00:05:37 +02:00
|
|
|
padding: var(--#{$prefix}accordion-btn-padding-y) var(--#{$prefix}accordion-btn-padding-x);
|
2020-11-02 20:36:51 +01:00
|
|
|
@include font-size($font-size-base);
|
2022-04-12 00:33:18 +02:00
|
|
|
color: var(--#{$prefix}accordion-btn-color);
|
2021-02-03 20:44:48 +01:00
|
|
|
text-align: left; // Reset button style
|
2022-04-12 00:33:18 +02:00
|
|
|
background-color: var(--#{$prefix}accordion-btn-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;
|
2022-04-12 00:33:18 +02:00
|
|
|
@include transition(var(--#{$prefix}accordion-transition));
|
2020-11-05 21:18:38 +01:00
|
|
|
|
2020-11-02 20:36:51 +01:00
|
|
|
&:not(.collapsed) {
|
2022-03-29 00:05:37 +02:00
|
|
|
color: var(--#{$prefix}accordion-active-color);
|
|
|
|
background-color: var(--#{$prefix}accordion-active-bg);
|
2022-09-03 09:09:07 +02:00
|
|
|
box-shadow: inset 0 calc(-1 * var(--#{$prefix}accordion-border-width)) 0 var(--#{$prefix}accordion-border-color); // stylelint-disable-line function-disallowed-list
|
2020-11-02 20:36:51 +01:00
|
|
|
|
|
|
|
&::after {
|
2022-04-12 00:33:18 +02:00
|
|
|
background-image: var(--#{$prefix}accordion-btn-active-icon);
|
|
|
|
transform: var(--#{$prefix}accordion-btn-icon-transform);
|
2020-11-02 20:36:51 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// Accordion icon
|
|
|
|
&::after {
|
|
|
|
flex-shrink: 0;
|
2022-04-12 00:33:18 +02:00
|
|
|
width: var(--#{$prefix}accordion-btn-icon-width);
|
|
|
|
height: var(--#{$prefix}accordion-btn-icon-width);
|
2020-11-02 20:36:51 +01:00
|
|
|
margin-left: auto;
|
|
|
|
content: "";
|
2022-04-12 00:33:18 +02:00
|
|
|
background-image: var(--#{$prefix}accordion-btn-icon);
|
2020-11-02 20:36:51 +01:00
|
|
|
background-repeat: no-repeat;
|
2022-04-12 00:33:18 +02:00
|
|
|
background-size: var(--#{$prefix}accordion-btn-icon-width);
|
|
|
|
@include transition(var(--#{$prefix}accordion-btn-icon-transition));
|
2020-11-02 20:36:51 +01:00
|
|
|
}
|
|
|
|
|
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;
|
2022-04-12 00:33:18 +02:00
|
|
|
border-color: var(--#{$prefix}accordion-btn-focus-border-color);
|
2020-11-02 20:36:51 +01:00
|
|
|
outline: 0;
|
2022-04-12 00:33:18 +02:00
|
|
|
box-shadow: var(--#{$prefix}accordion-btn-focus-box-shadow);
|
2020-11-02 20:36:51 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
.accordion-header {
|
|
|
|
margin-bottom: 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
.accordion-item {
|
2022-04-12 00:33:18 +02:00
|
|
|
color: var(--#{$prefix}accordion-color);
|
2022-03-29 00:05:37 +02:00
|
|
|
background-color: var(--#{$prefix}accordion-bg);
|
|
|
|
border: var(--#{$prefix}accordion-border-width) solid var(--#{$prefix}accordion-border-color);
|
2021-03-17 06:16:03 +01:00
|
|
|
|
2020-11-05 21:18:38 +01:00
|
|
|
&:first-of-type {
|
2022-03-29 00:05:37 +02:00
|
|
|
@include border-top-radius(var(--#{$prefix}accordion-border-radius));
|
2021-03-17 06:16:03 +01:00
|
|
|
|
2023-11-17 12:59:35 +01:00
|
|
|
> .accordion-header .accordion-button {
|
2022-04-12 00:33:18 +02:00
|
|
|
@include border-top-radius(var(--#{$prefix}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 {
|
2022-03-29 00:05:37 +02:00
|
|
|
@include border-bottom-radius(var(--#{$prefix}accordion-border-radius));
|
2021-03-17 06:16:03 +01:00
|
|
|
|
2023-11-17 12:59:35 +01:00
|
|
|
> .accordion-header .accordion-button {
|
2020-11-02 20:36:51 +01:00
|
|
|
&.collapsed {
|
2022-04-12 00:33:18 +02:00
|
|
|
@include border-bottom-radius(var(--#{$prefix}accordion-inner-border-radius));
|
2020-11-02 20:36:51 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2023-11-17 12:59:35 +01:00
|
|
|
> .accordion-collapse {
|
2022-03-29 00:05:37 +02:00
|
|
|
@include border-bottom-radius(var(--#{$prefix}accordion-border-radius));
|
2020-11-02 20:36:51 +01:00
|
|
|
}
|
|
|
|
}
|
2020-11-05 21:18:38 +01:00
|
|
|
}
|
2020-11-02 20:36:51 +01:00
|
|
|
|
|
|
|
.accordion-body {
|
2022-03-29 00:05:37 +02:00
|
|
|
padding: var(--#{$prefix}accordion-body-padding-y) var(--#{$prefix}accordion-body-padding-x);
|
2020-11-02 20:36:51 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// Flush accordion items
|
|
|
|
//
|
|
|
|
// Remove borders and border-radius to keep accordion items edge-to-edge.
|
|
|
|
|
|
|
|
.accordion-flush {
|
2023-11-17 12:59:35 +01:00
|
|
|
> .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; }
|
|
|
|
|
2023-11-17 12:59:35 +01:00
|
|
|
// stylelint-disable selector-max-class
|
|
|
|
> .accordion-header .accordion-button {
|
2022-09-01 21:55:45 +02:00
|
|
|
&,
|
|
|
|
&.collapsed {
|
|
|
|
@include border-radius(0);
|
|
|
|
}
|
2020-11-02 20:36:51 +01:00
|
|
|
}
|
2023-11-17 12:59:35 +01:00
|
|
|
// stylelint-enable selector-max-class
|
|
|
|
|
|
|
|
> .accordion-collapse {
|
|
|
|
@include border-radius(0);
|
|
|
|
}
|
2020-11-02 20:36:51 +01:00
|
|
|
}
|
|
|
|
}
|
Add dark mode support (#35857)
* Add dark mode to docs
* Minor fix: missing space indentation
* Minor fix: revert utilities/z-index added-in modification
* Remove prev: and next: from doc because extracted to another PR
* Use .bg-body-tertiary in all Utilities > Overflow examples
* fix example
* Fix up spacing examples
* Update box-shadow Sass variables and utilities to auto-adjust to color modes
* Remove unused docs class
* Refactor form styles to use CSS variable for background images on .form-check and .form-switch
* Fix docs selector
* Rename shortcut for clarity
* Heading consistency
* Reintroduce missing 4th grid item in Utilities > Spacing example
* Fix bundlewatch
* .bd-callout* rendering is OK so removing comments in the code
* Update scss/_utilities.scss
Co-authored-by: Julien Déramond <julien.deramond@orange.com>
* Fix gutters example styling
* Fix text colors on background utils docs
* redesign and fix up position marker example, which doesn't show nicely in darkmode but at least isn't broken
* fix some color utils examples
* Deprecate mixin notice
* Deprecate notice for list-group-item-variant() mixin
* Revamp new link CSS vars
* Use map-keys in some each Sass files
* Remove list-group-item-variant mixin ref in sass loop desc
* Display CSS vars scoped to our built-in dark mode
* Revert previous commit
* Fix list group variant link
* Fix typo
* Remove imports of alert/list-group mixins in scss/_mixins.scss
* Small formatting + comments removal in scss/_content.scss
* Fix alert links colors
* fix dropdown border-radius mixin
* fix link color and underline again, this time using CSS var override for color var and fallback value for the underline
* fix colors on docs navbar for dark mode
* remove two changes
* missing ref
* another link underline fix, just use sass vars for link decoration for now
* missing color bg docs, plus move dropdown override to scss
* more changes from review
* fix some examples, drop unused docs navbar styles, update docs navbar color mode to use mixin
* Few fixes around type
- Restored CSS variable for color on headings, this time with a fallback value
- In conjunction, restored and wrapped the default CSS var with a null value check
- Split headings and paragraphs docs in Reboot, elaborated on them
* Restyle custom details > summary element in docs
* Rewrite some migration docs
* fix form checks
* Fix up some navbar styling, tweak docs callout
* Fix select images, mostly for validation styling
* Clean up some migration notes, document some new form control CSS vars, mention new variables-dark in sass docs
* Update site/content/docs/5.2/components/scrollspy.md
Co-authored-by: Julien Déramond <julien.deramond@orange.com>
* Apply suggestions from code review
Co-authored-by: Julien Déramond <julien.deramond@orange.com>
* mention form control css vars in migration guide
* Tweak grid and flex docs background examples
* clarify some docs
* fix some more things
Co-authored-by: Julien Déramond <juderamond@gmail.com>
Co-authored-by: Julien Déramond <julien.deramond@orange.com>
2022-11-29 07:30:26 +01:00
|
|
|
|
|
|
|
@if $enable-dark-mode {
|
|
|
|
@include color-mode(dark) {
|
|
|
|
.accordion-button::after {
|
|
|
|
--#{$prefix}accordion-btn-icon: #{escape-svg($accordion-button-icon-dark)};
|
|
|
|
--#{$prefix}accordion-btn-active-icon: #{escape-svg($accordion-button-active-icon-dark)};
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|