6.4 forms.collapsible-fieldset Collapsible fieldset
Fieldsets with optional entry fields can be hidden with collapsed fieldsets.
Examples
Default styling
.is-collapsed
The collapsed fieldset.
Markup: forms/collapsible-fieldset/collapsible-fieldset.twig
<span class="xml"><span class="hljs-tag"><<span class="hljs-name">fieldset</span> <span class="hljs-attr">class</span>=<span class="hljs-string">"collapsible-fieldset </span></span></span><span class="hljs-template-variable">{{modifier_class}}</span><span class="xml"><span class="hljs-tag"><span class="hljs-string">"</span>></span>
<span class="hljs-tag"><<span class="hljs-name">legend</span>></span>
<span class="hljs-tag"><<span class="hljs-name">span</span> <span class="hljs-attr">class</span>=<span class="hljs-string">"collapsible-fieldset__legend"</span>></span>
A collapsible fieldset
<span class="hljs-tag"><<span class="hljs-name">span</span> <span class="hljs-attr">class</span>=<span class="hljs-string">"collapsible-fieldset__summary"</span>></span>A summary of the form state<span class="hljs-tag"></<span class="hljs-name">span</span>></span>
<span class="hljs-tag"></<span class="hljs-name">span</span>></span>
<span class="hljs-tag"></<span class="hljs-name">legend</span>></span>
<span class="hljs-tag"><<span class="hljs-name">div</span> <span class="hljs-attr">class</span>=<span class="hljs-string">"collapsible-fieldset__wrapper"</span>></span>
Place the form elements to hide inside this wrapping div.
<span class="hljs-tag"></<span class="hljs-name">div</span>></span>
<span class="hljs-tag"></<span class="hljs-name">fieldset</span>></span>
</span>
Source:
forms/collapsible-fieldset/_collapsible-fieldset.scss
, line 1