Code Monkey home page Code Monkey logo

Comments (1)

andymantell avatar andymantell commented on July 30, 2024

An interesting, related point of difference compared to govuk-frontend is that we place focus on the first h1 in the page whereas govuk-frontend places focus on the main wrapper.

They then have a class like this which is added by the JS, to remove the outline:

.govuk-skip-link-focused-element {
  &:focus {
    // Remove the native visible focus indicator when the element is programmatically focused.
    //
    // We set the focus on the linked element (this is usually the <main> element) when the skip
    // link is activated to improve screen reader announcements. However, we remove the visible
    // focus indicator from the linked element because the user cannot interact with it.
    //
    // A related discussion: https://github.com/w3c/wcag/issues/1001
    outline: none;
  }
}

While ours is hardcoded to the h1, the govuk-frontend one is more flexible and allows skip links that go to other places in the page. We have a couple of pages with more than one skip link on 111 online so this flexibility would be a useful addition.

My tendency would be to align ourselves with govuk-frontend here and drop their component in wholesale, but we would need to bottom out why the decision was made to focus the h1 instead of the main element. I had a look through the git history and seems to have always been this way since 2018 (See e58d885).

@mcheung-nhs what are your thoughts? Is the h1 behaviour significant, or just an arbitrary difference?

from nhsuk-frontend.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.