Skip to content

Commit

Permalink
Merge pull request #3833 from pulibrary/3803-highlighting-background
Browse files Browse the repository at this point in the history
Add background-color in highlighting that passes WCAG AAA with contrast ratio 8.27:1
  • Loading branch information
rladdusaw authored Nov 15, 2023
2 parents c3806fb + 5241a4a commit bbd3a95
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
4 changes: 4 additions & 0 deletions app/assets/stylesheets/components/search-results.scss
Original file line number Diff line number Diff line change
Expand Up @@ -89,3 +89,7 @@ dd.blacklight-electronic_access_display {
margin: 1em 0 0.5em 0;
}
}

em.highlight-query {
background-color: #FFFDD0;
}
11 changes: 11 additions & 0 deletions spec/features/accessibility_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,15 @@
.excluding('.blacklight-series_display[dir="ltr"]:nth-child(1) > .more-in-series[title=""][data-toggle="tooltip"]')
end
end
context "search results page" do
before do
allow(Flipflop).to receive(:highlighting?).and_return(true)
end

it 'complies with wcag2aa wcag21a' do
visit '/catalog?q=black+teenagers'
expect(page).to be_axe_clean
.according_to(:wcag2a, :wcag2aa, :wcag21a, :wcag21aa)
end
end
end

0 comments on commit bbd3a95

Please sign in to comment.