Sections are defined in the Layout package. View the Layout package on github.
Sections are containers for other components to be placed in. They look after responsive vertical spacing,
max-container-width, background colors, and grid column gap. They act as rows for content.
Twig: section.twig
<section class="section {{ modifier_class }}">
{% block background %}{% endblock %}
<div class="section__content {{ layout_class }}">
{% block content %}
<div class="vertical-flow">
<h2>Key feature or Section Name</h2>
<p>A short description to help explain enough about the subject matter to encourage visitors to learn more.</p>
<a class="button button--primary" href="#">Learn more</a>
</div>
{% endblock %}
</div>
</section>
This is experimental and not yet fully supported in FF.
see https://www.bram.us/2022/12/13/quantity-queries-for-islands-of-elements-with-the-same-class-thanks-to-css-has/
Twig: sections-flow.twig
<section class="section section--flow">
<div class="section__content {{ layout_class }}">
<p>first section has top and bottom spacing</p>
</div>
</section>
<section class="section section--flow">
<div class="section__content {{ layout_class }}">
<p>section with normal flow</p>
</div>
</section>
<section class="section section--flow">
<div class="section__content {{ layout_class }}">
<p>section with normal flow</p>
</div>
</section>
<section class="section section--group background--alt">
<div class="section__content {{ layout_class }}">
<p>certain sections can be</p>
</div>
</section>
<section class="section section--group background--alt">
<div class="section__content {{ layout_class }}">
<p>grouped togther as siblings</p>
</div>
</section>
<section class="section section--group background--alt">
<div class="section__content {{ layout_class }}">
<p>with their own spacing rules</p>
</div>
</section>
<section class="section section--flow">
<div class="section__content {{ layout_class }}">
<p>section on it's own has top and bottom spacing</p>
</div>
</section>
<section class="section section--flow section--group background--alt">
<div class="section__content {{ layout_class }}">
<p>groups can be combined with flow</p>
</div>
</section>
<section class="section section--flow section--group background--alt">
<div class="section__content {{ layout_class }}">
<p>for standard spacing</p>
</div>
</section>
<section class="section section--flow">
<div class="section__content {{ layout_class }}">
<p>section after group own has top and bottom spacing</p>
</div>
</section>
<section class="section section--flow">
<div class="section__content {{ layout_class }}">
<p>section with normal flow</p>
</div>
</section>
<section class="section section--flow background--alt">
<div class="section__content {{ layout_class }}">
<p>section with background that breaks the flow, also has top and bottom spacing</p>
</div>
</section>
<section class="section section--flow">
<div class="section__content {{ layout_class }}">
<p>section after background own has top and bottom spacing</p>
</div>
</section>
<section class="section section--flow">
<div class="section__content {{ layout_class }}">
<p>section with normal flow</p>
</div>
</section>
Sections stacked are defined in the Layout package. View the Layout package on github.
Example of multiple sections stacked with alternating background rows.
Twig: sections-stacked.twig
<section class="section section--xl background--alt">
<div class="section__content vertical-flow {{ layout_class }}">
<h2>Section Extra Large</h2>
<p>Extra Large spacing at the section level. Use the <code>section--xl</code> class to apply this spacing to the outter section.</p>
<a class="button button--primary" href="#">Learn more</a>
</div>
</section>
<section class="section section--l">
<div class="section__content vertical-flow {{ layout_class }}">
<h2>Section Large</h2>
<p>Large spacing at the section level. Use the <code>section--l</code> class to apply this spacing to the outter section.</p>
<a class="button button--primary" href="#">Learn more</a>
</div>
</section>
<section class="section section--m background--alt">
<div class="section__content vertical-flow {{ layout_class }}">
<h2>Section Medium</h2>
<p>Medium spacing at the section level. Use the <code>section--m</code> class to apply this spacing to the outter section.</p>
<a class="button button--primary" href="#">Learn more</a>
</div>
</section>
<section class="section section--s">
<div class="section__content vertical-flow {{ layout_class }}">
<h2>Section Small</h2>
<p>Small spacing at the section level. Use the <code>section--s</code> class to apply this spacing to the outter section.</p>
<a class="button button--primary" href="#">Learn more</a>
</div>
</section>