GitbookIO / styleguide

GitBook.com HTML/CSS Style Guide
http://styleguide.gitbook.com
Apache License 2.0
87 stars 23 forks source link

clarifying link/button confusion #33

Open garcialo opened 7 years ago

garcialo commented 7 years ago

Adding role="button" to a link doesn't make it act like a button. Removing recommendation to add role="button" to links. The role an element has should reflect its function; not its visual appearance.

It's okay to have links look like buttons, but the practice of repurposing links to act like buttons should not be encouraged. Even if some button functionality is added to the links (e.g. activated with Space Bar), it can be confusing if link functionality (e.g. 'open in new tab' in context menu) is not also removed. Using buttons as buttons should be encouraged.