Placeholder text are not styled by contrast themes

Description

The contrast themes do not style placeholder text. Placeholder text already has low contrast but when used with some contrast themes it is almost completely unreadable.

The placeholder text can be styled using the placeholder pseudo element.

https://developer.mozilla.org/en-US/docs/Web/CSS/::placeholder

Environment

None

Attachments

5

Activity

Show:

Cindy Li July 15, 2020 at 5:37 PM

The pull request that fixes this issue has been merged into the project repo master branch at this commit.

Dana July 7, 2020 at 3:51 PM
Edited

Thanks I think that's a great idea. I'll do some testing with the UIO contrast theme colours.

Justin Obara July 6, 2020 at 8:14 PM

 I was testing with Safari. The screenshots you posted gave me an idea. We could implement a similar behaviour across browsers by setting the colour of the placeholder and then specifying a lower opacity. Here is a jsFiddle with a quick example. https://jsfiddle.net/j15gyedp/ You can adjust the colour and opacity values to experiment.

Dana July 6, 2020 at 8:00 PM

thanks and sorry I missed that screen shot attachment the first time. Firefox seems to be doing something different than what you're seeing, I've attached a few screenshots. What browser are you using?

Justin Obara July 6, 2020 at 7:30 PM

 I guess the basic issue is that we do not style the placeholder text at all at the moment. So it always shows up in the browser default styling. I'm not exactly sure how to best handle it for the binary contrast themes like black-on-yellow, where we only use two colours. It would be hard to distinguish the placeholder text from the other text on the page. In the case of black-on-brown, that is a theme that using several colours so adjusting the colour to something that has better contrast but doesn't look like the rest of the text on screen might be fine.

Fixed

Details

Assignee

Reporter

Components

Priority

Created July 2, 2020 at 7:55 PM
Updated July 15, 2020 at 5:37 PM
Resolved July 15, 2020 at 5:37 PM