From 4bf96ffd3273286ebf171fa2bbe2150072033333 Mon Sep 17 00:00:00 2001 From: James Sinclair Date: Sat, 18 Feb 2017 07:34:49 +1100 Subject: [PATCH] Addressing accessibility issues with using links instead of buttons. --- src/css/simplemde.css | 12 +++++++++--- src/js/simplemde.js | 2 +- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/src/css/simplemde.css b/src/css/simplemde.css index 567d801..b04ce40 100644 --- a/src/css/simplemde.css +++ b/src/css/simplemde.css @@ -112,7 +112,9 @@ padding: 0; } -.editor-toolbar a { +.editor-toolbar a, +.editor-toolbar button { + background: transparent; display: inline-block; text-align: center; text-decoration: none!important; @@ -120,18 +122,22 @@ width: 30px; height: 30px; margin: 0; + padding: 0; border: 1px solid transparent; border-radius: 3px; cursor: pointer; } .editor-toolbar a.active, -.editor-toolbar a:hover { +.editor-toolbar a:hover, +.editor-toolbar button.active, +.editor-toolbar button:hover { background: #fcfcfc; border-color: #95a5a6; } -.editor-toolbar a:before { +.editor-toolbar a:before, +.editor-toolbar button:before { line-height: 30px } diff --git a/src/js/simplemde.js b/src/js/simplemde.js index 3565d9d..9b50513 100644 --- a/src/js/simplemde.js +++ b/src/js/simplemde.js @@ -96,7 +96,7 @@ function fixShortcut(name) { */ function createIcon(options, enableTooltips, shortcuts) { options = options || {}; - var el = document.createElement("a"); + var el = document.createElement("button"); enableTooltips = (enableTooltips == undefined) ? true : enableTooltips; if(options.title && enableTooltips) {