-
Notifications
You must be signed in to change notification settings - Fork 45.7k
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: Using opacity as a percentage value in a css file will become 1% in the production build. #19747
Comments
A reproducing example, please. |
It doesn't look like this bug report has enough info for one of us to reproduce it. Please provide a CodeSandbox (https://codesandbox.io/s/new), a link to a repository on GitHub, or provide a minimal code example that reproduces the problem. Screenshots or videos can also be helpful if they help provide context on how to repro the bug. Here are some tips for providing a minimal example: https://stackoverflow.com/help/mcve |
Here is the code sandbox, as requested. |
Did you forget to commit CSS to the source sandbox you linked? What I see is: .App {
font-family: sans-serif;
text-align: center;
} |
I guess I forgot to press ctrl+s to save the changes. Should be up now. |
What a frustrating bug. It originates in I'd suggest tracking down which package didn't publish the fix by upgrading their relevant dependencies. Maybe @gaearon can move this issue to create-react-app. Otherwise we should file a new bug report with create-react-app and close it here. |
Thanks for the investigation and summary, @eps1lon! Migrated to facebook/create-react-app#9588 |
Using opacity as a percentage value in a css file will become 1% in the production build version, even though in the localhost website it will appear correctly. The way around this is to use a decimal value (ex. 0.95) for opacity.
React version: 16.13.1
Steps To Reproduce
code example:
.App {
font-family: sans-serif;
text-align: center;
opacity: 50%;
}
The current behavior
Opacity will change from any percentage value to 1% in app build version.
The expected behavior
Opacity will stay the same percentage in build version.
The text was updated successfully, but these errors were encountered: