WordPress.org

Make WordPress Core

Opened 4 months ago

Last modified 3 months ago

#26504 new defect (bug)

Semantic elements for non-link links

Reported by: GaryJ Owned by:
Milestone: Awaiting Review Priority: normal
Severity: normal Version: 3.8
Component: Administration Keywords:
Focuses: accessibility Cc:

Description

Using the revenge.css bookmarklet on the dashboard gives a very clear indication that some of the links on there are semantically incorrect - they should be buttons, even if they should look like links.

The Actual Buttons Are Actual section of this article sums it up nicely why.

Unless the accessibility team have indicated otherwise, each of the 74+ occurrences (only counting PHP files, more in JS files) of links with href="#" should probably be a <button>, so that screen readers interpret it as a button that does something, rather than a link that takes you somewhere. It also reduces the number of links that can be pulled out of context.

Appearance isn't a problem either - taking the "See 3 more…" from the screenshot:

// Original:
<a href="#">See 3 more…</a>

// New (might benefit from ARIA attribute):
<button class="no-button">See 3 more…</button>

// Basic CSS:
.no-button {
    background: none;
    border: none;
    color: #0074a2;
}
.no-button:hover {
    color: #2EA2C9;
    cursor: pointer;
}

Change History (7)

comment:1 jdgrimes4 months ago

  • Cc jdg@… added

comment:2 joedolson4 months ago

Agreed - if it behaves like a button, it should be a button. Speaking from the Accessibility team, this is a good suggestion. I'd recommend that this get broken up into discrete tickets, referencing buttons based on functionality/component or file, so that it's easier to handle, however -- as is, this is likely to end up as a mega ticket that nobody has the scope to handle...

comment:3 sharonaustin3 months ago

  • Cc sharon.austin.2014@… added

@GaryJ Would you mind if I took a crack at breaking this ticket up into smaller components? I'd like to lend a hand if I could.

comment:4 follow-up: GaryJ3 months ago

@sharonaustin,

Go ahead, knock yourself out with it :-)

comment:5 in reply to: ↑ 4 sharonaustin3 months ago

Replying to GaryJ:

@sharonaustin,

Go ahead, knock yourself out with it :-)

Okay, great--I'll try and get it done this weekend. I may be contacting you via email for further clarification as I break this down into smaller components, if that's okay.

comment:6 sharonaustin3 months ago

Ticket #26837 opened; I'd like a chance to check that I've handled the first ticket correctly before opening the rest of them for the admin screen. Any feedback is welcome.

comment:7 nacin3 months ago

  • Component changed from Accessibility to Administration
  • Focuses accessibility added
Note: See TracTickets for help on using tickets.