Skip to content

Commit

Permalink
Added section component
Browse files Browse the repository at this point in the history
  • Loading branch information
bymayo committed Feb 19, 2020
1 parent fc5342a commit 980b79a
Showing 1 changed file with 35 additions and 0 deletions.
35 changes: 35 additions & 0 deletions templates/_components/layout/section.twig
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
{#
Section
Outputs section layout with correct padding and container.
@type {embed}
@param {string} padding
@param {string} class
@param {bool} container
#}

{% if padding is not defined %}
{% set padding = 'topBottom' %}
{% endif %}

{% set paddingClass = {
top: 'pt-32',
bottom: 'pb-32',
topBottom: 'py-32',
} %}

<div class="section {{ class is defined ? class : 'bg-white' }} {{ attribute(paddingClass, padding) }}">

{% if container is not defined %}
<div class="section__container">
{% endif %}

{% block sectionContent %}
{% endblock %}

{% if container is not defined %}
</div>
{% endif %}

</div>

0 comments on commit 980b79a

Please sign in to comment.