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