Skip to content

Commit

Permalink
Fix padding of sticky sidebars
Browse files Browse the repository at this point in the history
  • Loading branch information
ahosgood committed Aug 8, 2024
1 parent dcc1685 commit acacc51
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 7 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

- Change skip link colours when hidden to avoid accessibility failures being raised
- Fixed incorrect use of `navigationId` and `topNavigationId` in global header component
- Fixed padding of sticky sidebars

### Security

Expand Down
20 changes: 13 additions & 7 deletions src/nationalarchives/components/sidebar/sidebar.scss
Original file line number Diff line number Diff line change
Expand Up @@ -109,29 +109,35 @@
* ------------------------------------------
*/
&--sticky {
max-height: calc(100vh - spacing.space(0.5));
max-height: calc(100dvh - spacing.space(0.5));
max-height: 100vh;
max-height: 100dvh;

display: flex;
flex-direction: column;
box-sizing: border-box;

position: sticky;
top: spacing.space(0.5);
top: 0;
}

&--sticky &__items {
width: 100%;
margin: 0;
padding-right: a11y.$focus-outline-padding;
padding-bottom: a11y.$focus-outline-padding;

overflow-y: auto;

flex: 1;
}

&--sticky#{&}--sections &__items,
&--sticky#{&}--pages &__items {
width: calc(100% - #{a11y.$focus-outline-padding});
padding-right: a11y.$focus-outline-padding;
padding-left: a11y.$focus-outline-padding;

box-sizing: content-box;
overflow-y: auto;

position: relative;
left: -#{a11y.$focus-outline-padding};
flex: 1;
}
}

0 comments on commit acacc51

Please sign in to comment.