question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Removal of :focus styles in tutorial code

See original GitHub issue

In the tutorial, the :focus styles are removed, which as we all know (or should) that this is not the best way to do this because of accessibility reasons. I know it’s a tutorial for a Tic-Tac-Toe game, but this teaches bad accessibility practices and needs to be, as well as should be fixed.

Keyboard accessibility is crucial to some, and using the TAB key to navigate is also crucial to those folks as well. As well as others who use the keyboard for navigation and/or a screen reader.

Whether you remove the code entire, which I have done and it is fine with thin dotted borders in Firefox, or the glowing green border color in Chrome/Edge and Safari, this sets a bad example. You could change this code below:

.square:focus {
  outline: none;
}

to look the same across the major modern browsers using:

.square:focus {
  outline: thin dotted;
}

It is my experience in the accessibility and programming spaces, that if you foster the idea of accessibility at the most fundamental levels, like tutorials, this fosters a pattern of positivity towards accessibility. Teaching juniors to remove the default:focus styling in the browser needs to stop so they can learn the fundamentals of accessibility as well as programming.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:14
  • Comments:9

github_iconTop GitHub Comments

1reaction
Lewiscowles1986commented, Jun 25, 2020
0reactions
Lewiscowles1986commented, Jun 26, 2020

I said everything and pointed out two examples

  • background color
  • text color

I’ll be honest Bow out, enjoy your weekend and life as far as I’m concerned this is peak React Dev. If something is clipping outline, surely removing the clipping, rather than coming up with hot takes on alternatives 🙄

Read more comments on GitHub >

github_iconTop Results From Across the Web

Focusing on Focus Styles
A common misconception is that the focus style can only use the outline property. It's worth noting that :focus is a selector like...
Read more >
Changing the Default Focus Styles
First, let's reset the focus style on every single HTML element. That can be done easily by specifying a universal selector with a...
Read more >
Better Focus Styles with CSS Pseudo-Class ... - Web Design
In this quick tip I'm going to show you how to create better focus styles on form elements with a CSS pseudo-class called...
Read more >
Better Focus Styles with CSS Pseudo-Class :focus-visible
In this quick tip, I'm going to show you how to create better focus styles with a CSS pseudo-class called :focus-visible.
Read more >
How to remove focus border outline around text input boxes ...
Here Easy Guideline with source css code : .form-control: focus ... Page Builder Tutorial : https://bit.ly/2Kj7oUT Digital Marketplace using ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found