gokarna-theme / gokarna-hugo

A minimal opinionated theme for Hugo
https://gokarna-hugo.netlify.app
GNU General Public License v3.0
358 stars 140 forks source link

Add screen reader support to dark theme button. #116

Closed nebeker closed 2 years ago

nebeker commented 2 years ago

The dark theme toggle button is currently unreacheable by screen readers (programs blind people use to access the internet). This adds a target for them, along with some invisible text, matching the state of the icon.

Improvement suggestions welcome.

netlify[bot] commented 2 years ago

Deploy Preview for gokarna-hugo ready!

Name Link
Latest commit 19cd8dc3b22ba2f5f26e50e6b7ad05c134b1601d
Latest deploy log https://app.netlify.com/sites/gokarna-hugo/deploys/62fa7c061f2f6400092af8db
Deploy Preview https://deploy-preview-116--gokarna-hugo.netlify.app
Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

yashmehrotra commented 2 years ago

Thanks for the PR @nebeker

Can you please hide this for non screenreaders, it looks ugly

image

nebeker commented 2 years ago

I removed the placeholder "theme" text, but the sr-only class should make it invisible anyway. It feels like the CSS didn't load. And this shouldn't be an "it works on my machine situation," it's a common enough thing to do that Boostrap has these classes.

yashmehrotra commented 2 years ago

Cool, LGTM

@526avijitgupta Can you take a second look and merge this ?