Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix accessibility issues #77

Merged
merged 20 commits into from
Nov 22, 2024
Merged

Fix accessibility issues #77

merged 20 commits into from
Nov 22, 2024

Conversation

delucis
Copy link
Member

@delucis delucis commented Nov 21, 2024

This is an omnibus PR fixing accessibility paper cuts and improving UX.

Non-visual changes

The following changes address assistive technology compatibility or other technical mark-up details but do not introduce visual differences comparing to the live site:

  • Updates Astro logo + “astro.new” lock-up in header so there aren’t two identical links to tab through, grouping them in a single link.
  • Use overflow-x-clip instead of overflow-x-hidden in browsers that support it to avoid the main content being focusable in browsers that automatically make elements focusable if they overflow.
  • Hide decorative icons from the accessibility tree using aria-hidden="true" in “Open in…” drop-down menus.
  • Prefer sr-only text over title attributes in “Open in…” drop-down menus. (Improved support for AT + things like browser auto-translation.)
  • Add a page-specific <h1> for assistive technology. Until now the “astro.new” text in the page header was an <h1> for the entire page. That is now regular paragraph text, so that the page gets a descriptive top-level heading.
  • Rework heading levels so the page has a better hierarchy of headings.
  • Associate headings with landmark regions to better label them.
  • Ensure SVGs have explicit width attributes so if CSS fails they don’t take up the entire viewport.
  • Optimize “resource” card icons for file size.

Visual changes

  • Darken “Open in StackBlitz” button backgrounds slightly so they pass text contrast requirements.

    Before After
    Open in StackBlitz button with a blue-purple gradient background Open in StackBlitz button with a slightly darker gradient background
  • Add a “Skip to content” link at the start of the document so keyboard users can jump over repeated introductory content to the main page content. Tabbing into the page reveals it in the top-left corner:
    Skip to content link

  • Redesign the three “resource” cards (docs, themes, community) at the bottom of the page so they can pass color contrast requirements.

    The current designs are super fun and bright, but basically impossible to get passing colour contrast on without dimming them and losing their vibrancy. The redesign retains the same structure, but limits the splash of colour to the icons.

    I also removed the gradient from the CTA button text on these cards as the purple shade here also fails colour contrast requirements.

    Before

    Three brightly coloured card components with white text and icons in the top-right corner

    After

    The same three cards, but now they have a dark gray background and the colour is just a blurry highlight in the top-right corner behind the icons

  • Other elements on the page with borders have also been updated to match the borders used on these new card designs. This is a subtle, mostly imperceptible change, but it exchanges a dim gray border (border-astro-gray-500) for a mostly transparent bright gray border. This allows any colours in the background to shine through when present.

    This is most noticeable in the bottom border on the navigation “tab bar” where it passes over the yellow background glow:

    Before After
    thin dim gray line over dark gray and yellow background, which gets kind of muddy over the yellow areas thin line over the same background which consistently highlights against both dark and light background colours

Browser testing

Tested on:

  • Chrome (macOS, Android)
  • Safari (macOS)
  • Firefox (macOS, Android)

Copy link

netlify bot commented Nov 21, 2024

Deploy Preview for astro-new ready!

Name Link
🔨 Latest commit ceeb1db
🔍 Latest deploy log https://app.netlify.com/sites/astro-new/deploys/6740727cab964f000853d4df
😎 Deploy Preview https://deploy-preview-77--astro-new.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

Copy link
Member

@sarah11918 sarah11918 left a comment

Choose a reason for hiding this comment

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

Checking in Chrome, the new site feels overall more readable!

@delucis delucis merged commit f9b03b6 into main Nov 22, 2024
5 checks passed
@delucis delucis deleted the chris/a11y-pass branch November 22, 2024 12:07
@delucis delucis mentioned this pull request Nov 22, 2024
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.

2 participants