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

Bug: Opacity Reduces to 1% When Adding a Background Image with a defined Opacity #139

Open
Jackmt9 opened this issue Jan 11, 2021 · 2 comments

Comments

@Jackmt9
Copy link

Jackmt9 commented Jan 11, 2021

React version: 16.13.1

Steps To Reproduce
Set a css property background-image: url(...)
Deploy the project (BUG ONLY VISIBLE ON PRODUCTION BUILD)
Link to code example: https://github.com/Jackmt9/portfolio_site/tree/9f6b1f53f33f22386cf473bdc956774027059035
(See about and home page - there should be an image there.)

The current behavior
Opacity of the image reduces to 1%

The expected behavior
Opacity should be as defined, not 1%

##Workaround
Set the opacity value as a decimal instead of a percentage (90% => 0.9)

Also see:
facebook/react#20569
facebook/create-react-app#7980 (comment)

@jrr
Copy link

jrr commented May 20, 2021

To anyone else that hits this, you might be interested in a stylelint rule to prohibit percentage-based opacity:

https://stylelint.io/user-guide/rules/alpha-value-notation

@rolandoff
Copy link

Hey guys, any news on this? I'm still facing this issue and I'm not really sure how to fix it.

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

3 participants