[wp-trac] [WordPress Trac] #37011: Don’t link custom logo if it’s displayed on the front page

WordPress Trac noreply at wordpress.org
Mon Jun 15 14:35:02 UTC 2020


#37011: Don’t link custom logo if it’s displayed on the front page
-------------------------------------------------+-------------------------
 Reporter:  FlorianBrinkmann                     |       Owner:  joedolson
     Type:  enhancement                          |      Status:  accepted
 Priority:  normal                               |   Milestone:  5.5
Component:  Themes                               |     Version:  4.6
 Severity:  normal                               |  Resolution:
 Keywords:  has-patch needs-dev-note 2nd-        |     Focuses:
  opinion                                        |  accessibility
-------------------------------------------------+-------------------------

Comment (by afercia):

 Replying to [comment:14 knutsp]:

 > A logo is about visual identity, and hat is in my interpretation almost
 the opposite of. As I read
 https://www.w3.org/WAI/tutorials/images/decorative/ a logo is not such.
 It's not "Identified and described by surrounding text". The logo is
 usually there instead of the site title, usually a part of the H1 tag
 itself.
 >
 > The alt text must be the site title.

 Considering the logo "in isolation", as if there was no other content, yes
 maybe this would be correct. However, in practice, things are a bit
 different.

 Almost all the bundled themes, and I guess the vast majority of the
 themes, output the logo together with or close to the site branding
 ''text'', which is often the main H1.

 For example, Twenty Twenty outputs the logo ''inside'' the main H1 text
 (visually hidden with screen-reader-text). As a result, the site title is
 announced ''twice''. This isn't ideal.

 Similarly, Twenty Nineteen outputs the logo ''before'' the main H1: the
 site title will be read out twice when screen reader users navigate the
 page content.

 In the cases above, the logo alt text needs to be empty.

 For clarity, see screenshots below.

 Overall, this is one more case where the same image should use a different
 alt text depending on the context. At the moment, WordPress doesn't have
 the ability to use contextual alt text. See ongoing discussion on #47456.

 From a themes perspective, I'm wondering if `the_custom_logo()` and
 `get_custom_logo()` should be changed to allow to pass a text for the alt
 attribute.

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/37011#comment:19>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list