Accordion

The accordion component should be used to show optional content, so that the user can decide if he/she is going to read the information.

Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet.

<div class="card accordion">
	<div class="accordion__header">
		<h4 class="h4 accordion__header__headline">Description</h4>
		<div class="icon accordion__header__arrow">
			<img src="./icons/angle-down-light.svg" >
		</div>
	</div>
	<div class="accordion__body">
		<p class="p accordion__body__p">Your Content</p>
	</div>
</div>

Notes

To close the accordion you have to add the --closed modifier to accordion__body, accordion__header and accordion__header__arrow.

SCSS

.accordion {
	&__header {
		border-bottom: 1px solid $light-grey;
		display: flex;
		align-items: center;
		justify-content: space-between;
		padding-bottom: em(10);
		transition: all 0.6s ease;
		cursor: pointer;
		&--closed {
			border-bottom: none;
			padding: 0;
		}
		&__headline {
			margin: 0;
		}
		&__arrow {
			font-size: em(14);
			color: $grey-2;
			transition: all 0.6s ease;
			&--closed {
				transform: rotate(180deg);
			}
		}
	}

	&__body {
		padding-top: em(15);
		transition: all 0.6s ease;
		&--closed {
			height: 0;
			overflow: hidden;
			padding: 0;
		}
		&__p {
			margin: 0;
		}
	}
}