Skip to content

Commit

Permalink
Fixed: Padding variables inside section
Browse files Browse the repository at this point in the history
  • Loading branch information
bymayo committed Jun 14, 2021
1 parent 5d8bc3c commit 3fab22b
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion templates/_blocks/_block.twig
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{% embed '_components/section' with {
paddingX: block.padding
paddingY: block.padding
} %}

{% block sectionContent %}
Expand Down
12 changes: 6 additions & 6 deletions templates/_components/section.twig
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,15 @@
@type {embed}
@param {string} paddingX
@param {string} paddingY
@param {string} paddingXSize
@param {string} paddingYSize
@param {string} class
#}

{% set paddingX = padding ?? 'leftRight' %}
{% set paddingY = padding ?? 'topBottom' %}
{% set paddingX = paddingX ?? 'leftRight' %}
{% set paddingY = paddingY ?? 'topBottom' %}

{% set paddingXSize = paddingSize ?? 'base' %}
{% set paddingYSize = paddingYSize ?? 'base' %}

{% set paddingXClass = {
leftRight: 'px-10',
Expand All @@ -22,7 +22,7 @@
none: 'px-0'
} %}

{% set paddingClass = {
{% set paddingYClass = {
small: {
top: 'pt-16',
bottom: 'pb-16',
Expand All @@ -37,7 +37,7 @@
}
} %}

<div class="w-full {{ attribute(attribute(paddingYClass, paddingSize), paddingY) }}{{ class is defined ? ' ' ~ class }}">
<div class="w-full {{ attribute(attribute(paddingYClass, paddingYSize), paddingY) }}{{ class is defined ? ' ' ~ class }}">

<div class="{{ attribute(paddingXClass, paddingX) }}">

Expand Down

0 comments on commit 3fab22b

Please sign in to comment.