Skip to content

Enhance accessibility features and improve layout responsiveness#18

Open
Pavlusha311245 wants to merge 1 commit into
freeunitorg:mainfrom
Pavlusha311245:feature/layout_improvements
Open

Enhance accessibility features and improve layout responsiveness#18
Pavlusha311245 wants to merge 1 commit into
freeunitorg:mainfrom
Pavlusha311245:feature/layout_improvements

Conversation

@Pavlusha311245
Copy link
Copy Markdown
Member

A personal suggestion for improving the documentation website interface

  • Added comprehensive accessibility widget with multiple modes
  • Implemented localStorage persistence for accessibility preferences
  • Improved keyboard accessibility and added toggle functionality for mobile menu
  • Major layout update to CSS Grid for better responsiveness
  • Updated typography scaling and line-height for enhanced readability
  • Fixed various layout and animation issues for better user experience
image image image

- Added comprehensive accessibility widget with multiple modes
- Implemented localStorage persistence for accessibility preferences
- Improved keyboard accessibility and added toggle functionality for mobile menu
- Migrated layout to CSS Grid for better responsiveness
- Updated typography scaling and line-height for enhanced readability
- Fixed various layout and animation issues for better user experience
Copy link
Copy Markdown

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces a comprehensive accessibility overhaul for the FreeUnit documentation, including a new accessibility widget with multiple display modes, mobile navigation improvements, and keyboard accessibility enhancements. The review feedback highlights specific WAI-ARIA improvements for the search functionality, mobile menu, and accessibility panel to ensure better screen reader support.

Comment on lines +655 to +666
if (e.key === 'ArrowDown' || e.key === 'ArrowUp') {
e.preventDefault()
const items = Array.from(container.querySelectorAll('.nxt_search_item'))
if (!items.length) return
const cur = container.querySelector('.nxt_search_item.nxt_active')
let idx = items.indexOf(cur)
items.forEach(i => i.classList.remove('nxt_active'))
if (e.key === 'ArrowDown') idx = Math.min(idx + 1, items.length - 1)
else idx = Math.max(idx - 1, 0)
items[idx] && items[idx].classList.add('nxt_active')
items[idx] && items[idx].scrollIntoView({ block: 'nearest' })
}
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

high

The keyboard navigation for search results should update the aria-selected attribute on the items and the aria-activedescendant attribute on the input field to comply with the WAI-ARIA Combobox pattern. This allows screen readers to announce the currently highlighted result as the user navigates with arrow keys.

Comment on lines +186 to +197
function openMenu() {
side.classList.add('side-open')
overlay && overlay.classList.add('overlay-open')
btn.setAttribute('aria-expanded', 'true')
btn.textContent = '✕'
}
function closeMenu() {
side.classList.remove('side-open')
overlay && overlay.classList.remove('overlay-open')
btn.setAttribute('aria-expanded', 'false')
btn.textContent = '☰'
}
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

When the mobile menu is toggled, the aria-label on the button should be updated to reflect the current state (e.g., 'Close navigation' when open). This ensures screen reader users understand the action the button will perform.

    function openMenu() {
        side.classList.add('side-open')
        overlay && overlay.classList.add('overlay-open')
        btn.setAttribute('aria-expanded', 'true')
        btn.setAttribute('aria-label', 'Close navigation')
        btn.textContent = '✕'
    }
    function closeMenu() {
        side.classList.remove('side-open')
        overlay && overlay.classList.remove('overlay-open')
        btn.setAttribute('aria-expanded', 'false')
        btn.setAttribute('aria-label', 'Open navigation')
        btn.textContent = '☰'
    }

Comment thread source/theme/layout.html
<div id="a11y-panel"
role="dialog"
aria-label="Accessibility settings"
aria-modal="false"
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The accessibility panel uses a focus trap in JavaScript but is marked with aria-modal="false". If the panel is intended to behave as a modal dialog (preventing interaction with the rest of the page), it should be set to aria-modal="true". If it is a non-modal overlay, the focus trap should be removed to allow keyboard users to navigate out of the panel naturally.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant