Skip to content

Commit 48cc12d

Browse files
committed
Merge branch '240-add-skip-link' into 'main'
Resolve "Accessibility : Add a skip link in base template" Closes #240 See merge request yaal/canaille!244
2 parents 7766ea7 + a20b84a commit 48cc12d

File tree

2 files changed

+13
-1
lines changed

2 files changed

+13
-1
lines changed

canaille/static/css/base.css

+11
Original file line numberDiff line numberDiff line change
@@ -43,12 +43,23 @@ body {
4343

4444
.menu-container {
4545
margin-bottom: 1em;
46+
margin-top: 1rem;
4647
}
4748

4849
.menu-container .ui.item.menu {
4950
justify-content: normal;
5051
}
5152

53+
#skip-link {
54+
position:absolute;
55+
top:-200px;
56+
}
57+
58+
#skip-link:focus {
59+
position:absolute;
60+
top:8px;
61+
}
62+
5263
footer {
5364
font-size: x-small;
5465
text-align: center;

canaille/templates/base.html

+2-1
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@
5959
{% block menu %}
6060
{% if menu %}
6161
<div class="ui container menu-container">
62+
<a id="skip-link" href="#submenu">{% trans %}Skip main menu{% endtrans %}</a>
6263
<nav class="ui stackable labeled icon seven item {% if self.submenu() | trim %}{% if not no_secret_key %}top {% endif %}attached{% endif %} menu">
6364
{% if logo_url %}
6465
<a href="/" class="item logo">
@@ -114,7 +115,7 @@
114115
{% endif %}
115116
</nav>
116117
{% if self.submenu() | trim %}
117-
<nav class="ui bottom attached equal width borderless menu">
118+
<nav id="submenu" class="ui bottom attached equal width borderless menu">
118119
{% block submenu %}{% endblock %}
119120
</nav>
120121
{% endif %}

0 commit comments

Comments
 (0)