Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • B bootstrap
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 263
    • Issues 263
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 114
    • Merge requests 114
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Package Registry
    • Infrastructure Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • Bootstrap
  • bootstrap
  • Merge requests
  • !30079

Use `aria-current` where appropriate

  • Review changes

  • Download
  • Email patches
  • Plain diff
Merged Administrator requested to merge github/fork/ffoodd/docs/aria-current into master Jan 24, 2020
  • Overview 1
  • Commits 17
  • Pipelines 0
  • Changes 18

Created by: ffoodd

aria-current attribute has many advantages and a single drawback compared to visually hidden text like <span class="sr-only">(current)</span> — let me explain:

  • it's standardized as part of ARIA 1.1
  • it's widely supported by browsers and screen readers
  • it's interoperable and programmatic, so can be usedby any tool reading the markup
  • internazionalition and localization is not a thing, assistive technologies take care of it
  • it allows to fine tune the context with its diffrent values (page, true, date, step, location, etc.)
  • it could be used as a style hook by using [aria-current], thus replace the .active state (didn't push this much, but could if you like the idea) — and also as a JavaScript hook, obviously.

The single drawback is that is does not appear when CSS is missing, whereas the visually hidden text does.

I think aria-current wins, so here's a full PR making a few different things:

  • add aria-current in components already using .active (only if appropriate, obviously — so not in JavaScript tabbed interface, for example) ;
  • mention aria-current beside .active in thos components' documentation;
  • update examples templates accordingly;
  • apply aria-current in docs navigations as well (main nav, sidenav, versions dropdowns).

And as usually, each of those lives in its very own commit.

Assignee
Assign to
Reviewers
Request review from
Time tracking
Source branch: github/fork/ffoodd/docs/aria-current