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 sl-input[type="date|time"] placeholder on macOS Safari #1341

Merged
merged 1 commit into from Jun 12, 2023

Conversation

brendon
Copy link
Contributor

@brendon brendon commented May 17, 2023

Allowing the background to inherit rather than removing it allows the weird date and time placeholder text opacity to work on macOS Safari.

  • The change doesn't seem to affect macOS Firefox and Chrome. I've not tested further.
  • Using inherit allows the dark and light theme background colours to come through correctly.
  • Further investigation around how this interacts with 'filled' inputs is probably needed.

Fixes #1334

Allowing the background to inherit rather than removing it allows the weird date and time placeholder text opacity to work on macOS Safari.
@vercel
Copy link

vercel bot commented May 17, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated (UTC)
shoelace ✅ Ready (Inspect) Visit Preview May 17, 2023 9:27pm

@claviska
Copy link
Member

Before

Without any customizations, this is what it looks like in Safari right now:

CleanShot 2023-05-25 at 11 57 01@2x CleanShot 2023-05-25 at 11 57 37@2x

The contrast between the blue highlight and the black text is 3.56 (AA).

CleanShot 2023-05-25 at 11 59 05@2x

After

Here's what it looks like after the proposed change:

CleanShot 2023-05-25 at 11 57 56@2x CleanShot 2023-05-25 at 11 58 06@2x

Note that the contrast is now 2.12 (failing).

CleanShot 2023-05-25 at 11 59 43@2x

Reading through #1334 again, I'm not sure what this change is improving. Did I miss something when I reviewed it?

Thanks!

@brendon
Copy link
Contributor Author

brendon commented May 25, 2023

Hi @claviska, the original issue is that by removing the background on the input, the input appears to be already filled in even though it's not. The placeholder text becomes basically black instead of light grey. To me it becomes a usability thing as it's not easy to tell if the field is filled in or what parts of the field need to still be filled in.

@claviska
Copy link
Member

Ah, thanks for clarifying. Well, if this is how the browser renders it by default, I guess we shouldn't override it and make it even more confusing. 🤷🏻‍♂️

@claviska claviska merged commit bd3b2c9 into shoelace-style:next Jun 12, 2023
1 check passed
@brendon
Copy link
Contributor Author

brendon commented Jun 12, 2023

Thanks Cory! :)

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.

Placeholder text for Date and Time sl-input types incorrectly coloured
2 participants