-
-
Notifications
You must be signed in to change notification settings - Fork 375
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
CSS opacity capped at 1% when using percentage units #1190
Comments
I have checked out the repository you've provided but the opacity seems to work correctly on my system. Have you tried deleting |
Oh sorry for that, I forgot to mention something important. This bug only happens for production builds. I will edit my first comment.... yarn run build && yarn run serve Also it seems like the lock file is included in |
Thanks, that I can reproduce. It seems to be an issue only affecting CSS Modules. Importing the style sheet into the component works without issue. I'll try to take a look, see what might cause that. I don't know why the lock file is excluded by the |
PR for lockfile inclusion |
minified CSS module is affected. Inline style in JSX This also means that inline styles are not minified (or at least are not processed the same way). |
The bug stems from an issue with |
so do we need to bumpsome of our dep and re-release? |
Well currently there's nothing to bump. The lib author just says a fix "will be released soon". The fix was merged back on Feb 21, so "soon" is pretty vague, as the fix has already been around for 3 months without a release to make that fix public. In the meantime, the author suggests using However, opacity with percentages as units isn't even supported across the board by browsers, so there's always the possibility of ignoring this for a bit. Don't know how much effort anyone wants to put into fixing something that already won't work on a significant portion of the internet anyways. |
Create-react-app is hitting some bug around `cssnano` as described here: preactjs/preact-cli#1190 Just convert % to floats.
Fixed with |
Do you want to request a feature or report a bug?
bug
What is the current behaviour?
CSS
opacity
with units as a [percentage] is capped at1%
for production builds.If the current behaviour is a bug, please provide the steps to reproduce.
Minimal example:
jennydaman/opacity-onepercent-bug@c98943d
Repo above was created using
preact create --yarn --git default preact-opacity-bug
yarn run build && yarn run serve
What is the expected behaviour?
opacity: 67%
or whateverPlease mention other relevant information.
I think this might be a bug with webpack's
css-loader
, however I am unfamiliar with the code base (both preact-cli and css-loader). I'm hoping for a pointer on where this bug report should be made to or hints on how to trace/isolate the bug.The text was updated successfully, but these errors were encountered: