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

Barely visible input placeholder in Firefox #2886

Open
crabvk opened this issue Mar 25, 2020 · 14 comments
Open

Barely visible input placeholder in Firefox #2886

crabvk opened this issue Mar 25, 2020 · 14 comments

Comments

@crabvk
Copy link

crabvk commented Mar 25, 2020

Bulma CSS framework, bug
Bulma version 0.8.2
Firefox Developer Edition 75.0b7

Description:
Firefox default opacity: 0.5 for input/textarea placeholders makes them barely visible.

@ghost
Copy link

ghost commented Mar 25, 2020

Can you provide a screenshot?

@crabvk
Copy link
Author

crabvk commented Mar 26, 2020

Sure
screen

@jgthms
Copy link
Owner

jgthms commented Mar 26, 2020

Probably same issue as #2885

@crabvk
Copy link
Author

crabvk commented Mar 26, 2020

Just tested with revert of 5ba407b, the problem still exists.

@ondrej-tucek
Copy link

Hi, I don't want to open a new issue because it's maybe the same error. If I open bulma.io -> form with FF v74 (left screenshot), the color of placeholder is different than in Chromium v80 (right).

compare

@surister
Copy link

surister commented Apr 2, 2020

Yeah, placeholder opacity is almost invisible in Firefox, maybe make this modifiable via variables?
image

@scheinercc
Copy link

scheinercc commented Apr 6, 2020

In order to make it cross browser compatible the RGBA value needs to be replaced, as it doesn't work for Firefox. It adds up the color's opacity, set in Bulma, with the base opacity of Firefox.
Changing it to separate color and opacity value instead, will give the same result in the browsers:

https://github.com/jgthms/bulma/blob/master/sass/form/shared.sass#L19
https://github.com/jgthms/bulma/blob/master/sass/form/shared.sass#L52

L19:

$input-disabled-placeholder-color: $input-disabled-color !default
$input-disabled-placeholder-opacity: 0.3 !default

L52:

    +placeholder
          color: $input-disabled-placeholder-color
          opacity: $input-disabled-placeholder-opacity

This will not have any negative effect on peoples' current settings for $input-disabled-placeholder-color - it should come out just the same.

relates to #2168: https://github.com/jgthms/bulma/search?q=%24input-disabled-placeholder-color&unscoped_q=%24input-disabled-placeholder-color

(sorry for the many little edits)

Note: changing this might also (positively!?) affect #2891

@stale
Copy link

stale bot commented Oct 19, 2020

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale label Oct 19, 2020
@scheinercc
Copy link

@jgthms what do you think of my suggestion above? RGB + opacity works in all browsers, while RGBA values only in some.

@stale stale bot removed the stale label Oct 20, 2020
@rukshn
Copy link

rukshn commented Dec 14, 2020

I can also confirm that the placeholders are barely visible on FireFox, please fix in coming release @jgthms

@terabytesoftw
Copy link

image

  • That capture is Chrome, as seen in FireFox, Edge, the color of the placeHolder must be corrected.

@getup8
Copy link

getup8 commented Jul 2, 2021

As a workaround, set the placeholder color variable to whatever color you actually want it to be:

$input-placeholder-color: #999;

And then make sure Firefox shows it at 100% opacity:

::placeholder {
  opacity: 1;  // For Firefox.
}

I do think it'd make sense to add that opacity setting to bulma to account for Firefox.

scheinercc added a commit to scheinercc/bulma that referenced this issue Jul 4, 2021
This is a bug fix.

Issue: jgthms#2886

TL;DR Firefox and Safari/Chrome have different computed styles for placeholders. The current implementation only targets Safari/Chrome and renders them too faint in Firefox.

### Proposed solution
Split the single RGBA color value into a solid color and an opacity value. This renders the placeholder the same in all browsers.

### Tradeoffs
Users who change the  alpha values of `$input-placeholder-color` and `$input-disabled-placeholder-color`, would have to set that alpha value now in the new `$input-placeholder-opacity` and `$input-disabled-placeholder-opacity`.

No changes if the alpha value has not been altered.
@stale
Copy link

stale bot commented Apr 18, 2022

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale label Apr 18, 2022
@scheinercc
Copy link

scheinercc commented Apr 19, 2022

@jgthms you mind taking a quick look. It's a pretty small change. Cheers

@stale stale bot removed the stale label Apr 19, 2022
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

No branches or pull requests

8 participants