Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(signature): add dark mode support for signature drawing #47

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

AhmadBilalAmjad
Copy link
Contributor

Issue

The signature input component was originally hard coded to always use black (strokeStyle = 'black'`) for the signature drawing, making it invisible in dark mode, where the background is dark.

Problem Details

  1. The original code had a fixed stroke color.
  2. This caused poor visibility issues:
  • In dark mode, black signatures were difficult or impossible to see against dark backgrounds
  • No consideration for user's theme preferences
  • Inconsistent with the system's theming system

Fix

The fix implements dynamic color switching to ensure the signature remains visible regardless of the theme setting, using:

  • White (#ffffff) for dark mode
  • Black (#000000) for light mode
  • Show the right signature color for the system's preferred theme

Copy link

vercel bot commented Nov 30, 2024

@AhmadBilalAmjad is attempting to deploy a commit to the hasanharman's projects Team on Vercel.

A member of the Team first needs to authorize it.

@hasanharman
Copy link
Owner

Hi @AhmadBilalAmjad, Great catch, can you also fix the /components parts. I think you deserve this complete fix. After that I can approve. Thank you for your work.

@AhmadBilalAmjad
Copy link
Contributor Author

AhmadBilalAmjad commented Dec 5, 2024

Hi @hasanharman, Thanks for the kind words. It is already working there because I have fixed the component itself. Below are the screenshots:-

image

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants