mirror of https://github.com/luizdepra/hugo-coder.git

Igetin
24.00.2023 c9f0d57c46b537d2f2ee69c396483af598bc5624
refs
author Igetin <14016863+Igetin@users.noreply.github.com>
Thursday, August 24, 2023 21:00 +0200
committer GitHub <noreply@github.com>
Thursday, August 24, 2023 21:00 +0200
commitc9f0d57c46b537d2f2ee69c396483af598bc5624
tree 92492a971eb14d0814f05b33c185a114da0d0beb tree | zip | gz
parent c3df12d0bbc2dda164df904f6a487580a82da746 view | diff
Make the navigation menu keyboard-accessible (#833)

### Prerequisites

Put an `x` into the box(es) that apply:

- [x] This pull request fixes a bug.
- [x] This pull request adds a feature.
- [ ] This pull request introduces breaking change.

### Description

This PR makes the navigation hamburger menu accessible via a keyboard.
Since elements with `display: none` are not focusable, I decided instead
to reset the `display` property of the element to its default value. The
checkbox is now hidden in a different way by positioning it outside of
the viewport and making it transparent. This way, the checkbox is not be
visible, but is still focusable.

The checkbox can be focused by tabbing on a keyboard, and once the
checkbox is focused, pressing space will open or close the menu. Since
the checkbox itself is invisible, I have added a style to the label
element (the hamburger menu icon) that indicates the focus.

### Issues Resolved

#832

### Checklist

Put an `x` into the box(es) that apply:

#### General

- [x] Describe what changes are being made
- [x] Explain why and how the changes were necessary and implemented
respectively
- [x] Reference issue with `#<ISSUE_NO>` if applicable

#### Resources

- [x] If you have changed any SCSS code, run `make release` to
regenerate all CSS files

#### Contributors

- [x] Add yourself to `CONTRIBUTORS.md` if you aren't on it already
1 files deleted
1 files added
3 files renamed
2 files modified
14 ■■■■ changed files
CONTRIBUTORS.md 1 ●●●● diff | view | raw | blame | history
assets/scss/_navigation.scss 9 ●●●●● diff | view | raw | blame | history
resources/_gen/assets/scss/scss/coder-dark.scss_e229566deac2466dcd73d10d2fe9546d.content diff | view | raw | blame | history
resources/_gen/assets/scss/scss/coder-dark.scss_e229566deac2466dcd73d10d2fe9546d.json diff | view | raw | blame | history
resources/_gen/assets/scss/scss/coder.scss_38b4d05915c0483e6cb106e4f0efccbc.content 2 ●●● diff | view | raw | blame | history
resources/_gen/assets/scss/scss/coder.scss_38b4d05915c0483e6cb106e4f0efccbc.json 1 ●●●● diff | view | raw | blame | history
resources/_gen/assets/scss/scss/coder.scss_5e1eb8e37c42cdfb6215b61e44dcfa5f.json 1 ●●●● diff | view | raw | blame | history