From 6a379160d021bd57388f5d6bbb98174278ac174a Mon Sep 17 00:00:00 2001 From: AlmeroSteyn Date: Fri, 14 Apr 2017 12:50:12 +0200 Subject: [PATCH 1/2] Add accessibility to tabs in installation documentation --- docs/docs/installation.md | 97 ++++++++++++++++++++++++++++----------- 1 file changed, 71 insertions(+), 26 deletions(-) diff --git a/docs/docs/installation.md b/docs/docs/installation.md index 3072d7768e7eb..9d7d6cc941b62 100644 --- a/docs/docs/installation.md +++ b/docs/docs/installation.md @@ -12,31 +12,38 @@ redirect_from: next: hello-world.html --- React is flexible and can be used in a variety of projects. You can create new apps with it, but you can also gradually introduce it into an existing codebase without doing a rewrite.
React is flexible and can be used in a variety of projects. You can create new apps with it, but you can also gradually introduce it into an existing codebase without doing a rewrite. @@ -42,7 +42,7 @@ React is flexible and can be used in a variety of projects. You can create new a .display-target-fiddle .toggler .button-fiddle:focus, .display-target-newapp .toggler .button-newapp:focus, .display-target-existingapp .toggler .button-existingapp:focus { - background-color: #01333F; + background-color: #046E8B; color: white; } .display-target-fiddle .toggler .button-fiddle, @@ -68,7 +68,7 @@ React is flexible and can be used in a variety of projects. You can create new a
@@ -239,10 +239,10 @@ function setSelected(value){ var tabs = document.querySelectorAll('li[role="tab"]'); for (var i = 0; i < tabs.length; ++i) { var tab = tabs[i]; - if(tab.className === 'button-' + value) { + if (tab.className === 'button-' + value) { tabs[i].setAttribute('aria-selected', 'true'); tabs[i].setAttribute('tabindex', '0'); - }else { + } else { tabs[i].setAttribute('aria-selected', 'false'); tabs[i].setAttribute('tabindex', '-1'); } @@ -250,11 +250,11 @@ function setSelected(value){ } function keyToggle(e, value, prevTab, nextTab){ - if(e.keyCode === 37){ + if (e.keyCode === 37) { document.getElementById(prevTab).focus(); display('target', prevTab); } - if(e.keyCode === 39){ + if (e.keyCode === 39) { document.getElementById(nextTab).focus(); display('target', nextTab); }