Skip to content

Commit 7e245e0

Browse files
committed
Integrate code review feedback
* Updates mitlibraries-theme gem to v1.4 to use `_skip_links` partial * Adds `.skip-link` CSS rules (copied form `#skip` rules in style guide) * Removes `width: 0` rule to support Safari * Changes color of skip links on focus to white (this didn't come up during code review, but WAVE flags the blue-on-black as a contrast error)
1 parent 9eb4fb2 commit 7e245e0

File tree

5 files changed

+34
-52
lines changed

5 files changed

+34
-52
lines changed

Gemfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ gem 'graphql-client'
99
gem 'http'
1010
gem 'importmap-rails'
1111
gem 'jbuilder'
12-
gem 'mitlibraries-theme', git: 'https://github.com/mitlibraries/mitlibraries-theme', tag: 'v1.2'
12+
gem 'mitlibraries-theme', git: 'https://github.com/mitlibraries/mitlibraries-theme', tag: 'v1.4'
1313
gem 'puma'
1414
gem 'rails', '~> 7.0'
1515
gem 'sentry-rails'

Gemfile.lock

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
GIT
22
remote: https://github.com/mitlibraries/mitlibraries-theme
3-
revision: bcbe5d3de36a92d275085a045c5c4d8f30f33e62
4-
tag: v1.2
3+
revision: ba5bdc9840ef817ba0b92e522b92da3f52669fc3
4+
tag: v1.4
55
specs:
66
mitlibraries-theme (1.0.2)
77
rails (>= 6, < 8)

app/assets/stylesheets/partials/_shared.scss

+20
Original file line numberDiff line numberDiff line change
@@ -39,3 +39,23 @@
3939
}
4040
}
4141
}
42+
43+
.skip-link {
44+
position: absolute;
45+
overflow: hidden;
46+
top: 0;
47+
left: 0;
48+
height: 0;
49+
color: $gray-l2;
50+
background-color: $black;
51+
border-bottom: 2px solid $success;
52+
53+
&:focus {
54+
position: relative;
55+
display: block;
56+
height: auto;
57+
color: $white;
58+
width: 100%;
59+
padding: 5px 2%;
60+
}
61+
}
+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
<a class="skip-link sr sr-focusable" href="#main-menu">Skip to main menu</a>
2+
<a class="skip-link sr sr-focusable" href="#basic-search">Skip to search form</a>
3+
<% if current_page?(results_path) %>
4+
<a class="skip-link sr sr-focusable" href="#results">Skip to results</a>
5+
<% if @filters.present? %>
6+
<a class="skip-link sr sr-focusable" href="#filters">Skip to search filters</a>
7+
<% end %>
8+
<% end %>
9+
<% if controller.controller_name == 'record' && controller.action_name == 'view' %>
10+
<a class="skip-link sr sr-focusable" href="#full-record">Skip to metadata</a>
11+
<% end %>

app/views/layouts/application.html.erb

-49
This file was deleted.

0 commit comments

Comments
 (0)