ncase / nutshell

Make expandable explanations!
https://ncase.me/nutshell/
Creative Commons Zero v1.0 Universal
518 stars 32 forks source link

Make One of the Close Buttons a real <button> #22

Closed chriscoyier closed 1 year ago

chriscoyier commented 2 years ago

As a part of the notes in: https://github.com/ncase/nutshell/issues/19

This PR is just for one Close Button at the bottom of a Nutshell. If it can be a real <button>, then people can tab to it or otherwise focus it using assistive tech, and actually close the Nutshell.

If this is useful, I think there more buttons to fix, but I figured I'd keep this tight for now to see if this is wanted or not.

ncase commented 1 year ago

Apologies for the very late PR accept, but thank you so much @chriscoyier for doing this! Also, wow, I'm kinda honored you stopped by here – you probably get this a lot, but, I'm a fan, CSS-Tricks has saved my skin many times, and CodePen is fun & useful! And now I'm being schooled in Accessibility 101. Thanks again, and I'll make sure going forward to make all my buttons actually <button>s 👍

(Also thank you @Foggalong and @MachineThing for bringing up the accessibility issue in the first place!)