Remove column class which adds unwanted padding

That just took two hours and i'm still not doing it the way i *want* to do it.
This commit is contained in:
benjamin melançon 2018-10-21 18:58:22 -04:00
parent 96e3c54c7a
commit 74cec04cf6

View file

@ -80,7 +80,11 @@
{# Main section #}
{# Only group the main content into one wrapping element if it needs to be
separated from a sidebar or two. #}
{% set has_columns=false %}
{% if page.sidebar_first or page.sidebar_second %}
{% set has_columns=true %}
{% endif %}
{% if has_columns %}
<section class="section">
<main role="main" class="container">
{% endif %}
@ -96,13 +100,17 @@
set page = page|merge({
'content_attributes': create_attribute().addClass([
'main-content',
'column',
]),
})
%}
{% endif %}
{% if not has_columns %}
{# TODO figure out how to move the removeClass here
without a Twig parse error:
set page.content_attributes = page.content_attributes|removeClass('column') #}
{% endif %}
{# Main content #}
<div{{page.content_attributes}}>
<div{{page.content_attributes.removeClass('column')}}>
{{ page.content }}
</div>
{% endblock main_content %}