Skip to content

Commit

Permalink
adds skip links
Browse files Browse the repository at this point in the history
  • Loading branch information
actlikewill committed Aug 1, 2024
1 parent 80edbfb commit 8227e8e
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 3 deletions.
3 changes: 1 addition & 2 deletions liiweb/templates/liiweb/_hero_search.html
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
{% load i18n %}
<div class="row justify-content-center">
<div id="search" class="row justify-content-center">
<div class="col col-md-10 col-lg-8">
<form method="get" action="{% url 'search:search' %}" class="d-flex mb-2">
<input type="text"
class="form-control form-control-lg flex-grow-1"
placeholder="{% blocktrans %}Search {{ APP_NAME }}{% endblocktrans %}"
aria-label="{% blocktrans %}Search {{ APP_NAME }}{% endblocktrans %}"
autofocus=""
name="q"/>
<input type="submit"
class="btn btn-primary ms-2 btn-lg"
Expand Down
11 changes: 11 additions & 0 deletions peachjam/static/stylesheets/_global.scss
Original file line number Diff line number Diff line change
Expand Up @@ -179,3 +179,14 @@ html[data-user-agent*='pocketlaw'] .pocketlaw-hidden {
max-height: 25vh;
overflow-y: auto;
}

#skip-links li {
list-style-type: none;
}
#skip-links a {
position: absolute;
top: -201px;
}
#skip-links a:focus {
top: -1px;
}
9 changes: 8 additions & 1 deletion peachjam/templates/peachjam/_header.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,14 @@
{% load static i18n %}
<header>
{% block skip-links %}
<div id="skip-links">
<a href="#top">Go to page content</a>
<a href="#main-nav">Go to main menu</a>
<a href="#search">Go to the search field</a>
</div>
{% endblock %}
{% block top-bar %}<div>Top bar content</div>{% endblock %}
<nav class="navbar navbar-expand-lg shadow-sm">
<nav id="main-nav" class="navbar navbar-expand-lg shadow-sm">
<div class="container">
<a class="navbar-brand" href="{% url 'home_page' %}">
{% block navbar-logo %}Logo image{% endblock %}
Expand Down

0 comments on commit 8227e8e

Please sign in to comment.