Commentary
Accordions are the classic vertically collapsable content areas. Two formats are available a) classic primarily used for small amounts of text like FAQs and b) with a border whose color can be changed and meant primarily for an aside.
This implementation uses the HTML details
tag. This tag has built in the ability to open and close a content body.
This body can be a p
, div
or article
child.
This allows you to add any other element or component to the accordion.
Usage
Classes: | |
---|---|
.accordions |
Provides a container for a group of accordions. |
.accordion |
Defines an individual accordion item. |
.is-expander |
Provides an alternate layout for collapsable areas that can also be styled with a bottom border color. |
Alternative Border Modifiers: | .is-expander-primary , .is-expander-secondary , .is-expander-tertiary ,
.is-expander-link , .is-expander-success , .is-expander-warning , .is-expander-danger
|
Dependencies: | |
---|---|
File: | accordions.css |
Variables: | --bg-main, --bg-main-ter, --danger, --link, --margin, --mar-vert, --padding-normal, --primary, --radius-comp, --secondary,--shadow, --success, --tertiary, --text-comp, --warning, --weight-semibold |
Examples
Single Accordion
Accordion FAQ Details
Something small enough to escape casual notice.
Accordions Group
One - Accordion Quote
Profit is not the purpose of a business, but rather the test of its validity. The purpose of a business is to create and keep a customer.
Two - Accordion Details
Three - Accordion Details
Three Something small enough to escape casual notice.