Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
---
layout: _includes/layout-basic.njk
title: Collapsible Box
tags:
- component
- component_medium
contentTitle: Collapsible Box
content: <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate veli esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</p>
---
{% macro collapsibleBox(contentTitle, content) %}
<details class="collapsible-box">
<summary class="collapsible-box__title">
{{ contentTitle }}
</summary>
<div class="collapsible-box__content-wrapper">
{{ content | safe }}
</div>
</details>
{% endmacro %}
{{ collapsibleBox(contentTitle, content) }}
---
layout: _includes/layout-basic.njk
title: FAQ
tags:
- section
contentTitle: Frequently Asked Questions
---
{% include "component/collapsible-box.njk" as collapsibleBox %}
<section class="faq">
<h2 class="faq__title">
{{ contentTitle }}
</h2>
{{ collapsibleBox.(
'This is my question?',
'This is my answer!'
) }}
</section>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.