Skip to content

Commit

Permalink
new: Add a "skip to main content" accessibility anchor
Browse files Browse the repository at this point in the history
  • Loading branch information
marien-probesys committed Dec 9, 2022
1 parent 8ed7599 commit 63c6d9d
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 1 deletion.
20 changes: 20 additions & 0 deletions assets/stylesheets/application.css
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,26 @@ body {
}
}

.accessibility-nav {
position: absolute;

overflow: hidden;
clip: rect(0, 0, 0, 0);

width: 1px;
height: 1px;
}

.accessibility-nav:focus {
top: 1rem;
left: 1rem;

clip: auto;

width: auto;
height: auto;
}

.turbo-progress-bar {
position: fixed;
top: 0;
Expand Down
13 changes: 12 additions & 1 deletion templates/base.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,15 @@
</head>

<body>
<a
class="no-mobile accessibility-nav anchor--action"
href="#main-content"
tabindex="0"
data-turbo="false"
>
{{ 'Skip to main content' | trans }}
</a>

<div class="layout" id="layout">
<noscript>
<div class="layout__banner layout__banner--alert">
Expand Down Expand Up @@ -121,7 +130,9 @@
</div>
{% endif %}

{% block body %}{% endblock %}
<div id="main-content">
{% block body %}{% endblock %}
</div>
</div>

{{ include('_modal_dialog.html.twig') }}
Expand Down
1 change: 1 addition & 0 deletions translations/messages.en_GB.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -84,3 +84,4 @@ Type: Type
'This ticket is closed.': 'This ticket is closed.'
'assign yourself': 'assign yourself'
(yourself): (yourself)
'Skip to main content': 'Skip to main content'
1 change: 1 addition & 0 deletions translations/messages.fr_FR.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -84,3 +84,4 @@ Type: Type
'This ticket is closed.': 'Ce ticket est clos.'
'assign yourself': attribuez-vous
(yourself): (vous)
'Skip to main content': 'Accéder au contenu principal'

0 comments on commit 63c6d9d

Please sign in to comment.