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

fix: convert value for opacity consistency #842

Closed
wants to merge 2 commits into from

Conversation

anikethsaha
Copy link
Member

fix #829

Summary

  • If the opacity value is greater than 1, then fallback to 1
  • if the opacity value is greater than 1 and it is a percentage, then keep it as it is

@codecov-io
Copy link

codecov-io commented Nov 13, 2019

Codecov Report

Merging #842 into master will not change coverage.
The diff coverage is 100%.

Impacted file tree graph

@@           Coverage Diff           @@
##           master     #842   +/-   ##
=======================================
  Coverage   97.65%   97.65%           
=======================================
  Files         111      111           
  Lines        3333     3333           
  Branches     1009     1010    +1     
=======================================
  Hits         3255     3255           
  Misses         71       71           
  Partials        7        7
Impacted Files Coverage Δ
packages/postcss-convert-values/src/index.js 100% <100%> (ø) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update d4af903...1619936. Read the comment docs.

@alexander-akait
Copy link
Member

hm, it is invalid CSS syntax

@alexander-akait
Copy link
Member

invalid syntax === invalid minification

@anikethsaha
Copy link
Member Author

you meant the % is invalid ?

@alexander-akait
Copy link
Member

Yes, try to use this in browser

@anikethsaha
Copy link
Member Author

ohh,....I guess it should be then converted into decimal

opacity : 40

⬇️

opacity : 0.4

@alexander-akait
Copy link
Member

@anikethsaha we are not linter or something like what handle incorrect syntax

@anikethsaha
Copy link
Member Author

we are not linter or something like what handle incorrect syntax

😁 yea make sense

👍 closing

I guess good to close #829 too then !

@interactiveRob
Copy link

Actually percentage is valid syntax and it does work in the browser. Not sure if this has changed somewhat recently. I am running into the same issue on my project using a third-party library that uses % values for opacity.

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

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

Successfully merging this pull request may close these issues.

The value of opacity in less was been modified by cssnano if I specificied the value in percent form
4 participants