Use <main> element in semantically appropriate way

Assistive technologies use the `<main>` element to navigate around a document.
In `<main>` their users expect to find:

> [content] unique to the document, excluding any content that is
> repeated across a set of documents such as sidebars, navigation links,
> copyright information, site logos, and search forms…
— https://developer.mozilla.org/en/docs/Web/HTML/Element/main

Previously, the `<main>` element also wrapped the sidebar navigation. This
commit moves the `<main>` element to only wrap the content of the page when the
page has a navigation sidebar.

This commit also removes the `page-container` class which wasn’t being used for
anything.
This commit is contained in:
Chris Hill-Scott
2016-02-10 12:07:59 +00:00
parent a9064b51b8
commit 8e607debd4
3 changed files with 8 additions and 6 deletions

View File

@@ -63,9 +63,9 @@
{% endif %}
{% block content %}
<main id="content" role="main" class="page-container">
<div id="content">
{% block fullwidth_content %}{% endblock %}
</main>
</div>
{% endblock %}
{% block body_end %}

View File

@@ -5,9 +5,9 @@
<div class="column-one-third">
{% include "main_nav.html" %}
</div>
<div class="column-two-thirds column-main">
<main role="main" class="column-two-thirds column-main">
{% include 'flash_messages.html' %}
{% block maincolumn_content %}{% endblock %}
</div>
</main>
</div>
{% endblock %}

View File

@@ -1,6 +1,8 @@
{% extends "admin_template.html" %}
{% block fullwidth_content %}
{% include 'flash_messages.html' %}
{% block maincolumn_content %}{% endblock %}
<main role="main">
{% include 'flash_messages.html' %}
{% block maincolumn_content %}{% endblock %}
</main>
{% endblock %}