justinmayer / kagi

WebAuthn security keys and TOTP multi-factor authentication for Django
BSD 2-Clause "Simplified" License
91 stars 10 forks source link

Replace SvgPathImage with SvgPathFillImage for accessibility #75

Closed evanottinger closed 1 year ago

evanottinger commented 1 year ago

Currently, the QR code image_factory is SvgPathImage. This produces a black QR code with a transparent background. For users using dark mode on the Django admin panel, this presents an accessibility issue, shown below:

image

This demo QR code is not being reused in any production environment.

I propose changing the SvgPathImage to the SvgPathFillImage, which, according to qrcode documentation, "work the same, but also fill the background of the SVG with white." This makes the QR code visible to folks with vision impairments working in dark mode.

MarkusH commented 1 year ago

Nice. Thank you!