Skip to content

Commit

Permalink
Fix the tall menu problem
Browse files Browse the repository at this point in the history
- if the height of the contents list exceeds the height of the viewport users can't see the whole contents unless they scroll to the bottom of the page, where the sticky element hits the bottom and stops
- to fix this, we apply a max height of the viewport and an overflow y scroll, so that the element never exceeds the height of the viewport and can be scrolled
- also adding a bottom margin to prevent collision with the back to top link at the bottom
  • Loading branch information
andysellick committed Aug 2, 2022
1 parent 8ce0d0f commit 608f307
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions app/assets/stylesheets/views/_html-publication.scss
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@
@include govuk-media-query($from: desktop) {
position: sticky;
top: govuk-spacing(2);
max-height: 100vh;
overflow-y: auto;
margin-bottom: govuk-spacing(4);
}

.direction-rtl & {
Expand Down

0 comments on commit 608f307

Please sign in to comment.