I understand why you removed the focus outline, it's attention grabbing and doesn't mesh well with the design of the page. You are doing your best to provide real world apps, by providing competent UI. However by removing the focus outline, this continues the bad practice of developers of removing the outline, therefore frustrating users that interact the page by the keyboard.
When a user tries to navigate the Pig Game or Forkify by using Tab
on the keyboard, they will be completely lost, since there's no visual feedback.
But allowing focus outline is ugly and distracting for users that interact with a mouse. So here's a middle ground, don't allow the outline to show when clicking, but display it when focused by the keyboard. There's actually a CSS pseudo class for that, :focus-visible
but it has little support and has to be enabled. That's what this javascript library, focus-visible, solves.
On every project, you provide this cdn in the html page,
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/focus-visible.min.js"></script>
and in the css you provide the following code
/*
This will hide the focus indicator if the element receives focus via the mouse,
but it will still show up on keyboard focus.
*/
.js-focus-visible :focus:not(.focus-visible) {
outline: none;
}
However from a course perspective, I understand this is not a clean solution, since every starter project will have this ugly cdn script, which could break, and therefore show that pesky outline on mouse clicks again. I understand if you choose not to do this.
At the minimum, in the final Forkify project, provide the focus-visble library as package instead of a cdn, since your students already understand and are comfortable using npm packages, and briefly explain what this library solves. Even though this is a JS course, I think it would be a good exposure on being aware of web accessibility.