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

borderRadius property doesn't work in Firefox #11

Closed
canova opened this issue Jun 28, 2016 · 12 comments
Closed

borderRadius property doesn't work in Firefox #11

canova opened this issue Jun 28, 2016 · 12 comments

Comments

@canova
Copy link

canova commented Jun 28, 2016

I was looking to examples on Codepen and found out that borderRadius property is not working in Firefox. But working fine in Chrome. Codepen Link
Firefox version: 47

Screenshot in Firefox:
firefox

Screenshot in Chrome:
chrome

@lepryko
Copy link

lepryko commented Jun 28, 2016

Got the same problem with Edge and even IE11, I don't even see border-radius property in DOM, just transform.

@averyillson
Copy link

Are you using the -moz- prefix in the css?

@canova
Copy link
Author

canova commented Jun 28, 2016

@averyillson The javascript is dynamically creating the border-radius, it is not related to css file. Also Firefox doesn't use -moz- prefix for border-radius since Firefox 4.

@juliangarnier
Copy link
Owner

It's because getComputedStyle(div).getPropertyValue('border-radius') doesn't return anything on IE / FF;

Not sure if it's a browser bug or something else :
http://codepen.io/juliangarnier/pen/BzWmGx?editors=0111

Any ideas?

@canova
Copy link
Author

canova commented Jun 28, 2016

I found a SO question and it seems Firefox require a specific corner to get property value.
Working code:
http://codepen.io/canaltinova/pen/JKWMPR?editors=1111
SO link:
http://stackoverflow.com/questions/10803023/why-wont-getpropertyvalue-return-a-value-for-the-borderradius-property

@juliangarnier
Copy link
Owner

Ok thanks!
I think I'll change the way CSS animation is detected, and fallback to a value of 0 for properties that are not supported by getComputedStyle.

Will check this asap.

@seleckis
Copy link

Still not resolved :(

@juliangarnier
Copy link
Owner

@seleckis
Copy link

No, it is not: https://codepen.io/seleckis/pen/ZamqJp

@juliangarnier
Copy link
Owner

As @canaltinova said, Firefox always returns 0 when using borderRadius.
In your example, you have to specify the initial value like this:

anime({
  targets: 'div',
  borderRadius: ['80px', '0px'],
  direction: 'alternate',
  loop: true
});

Or if you really can't specify the initial value, you can also do this 😂

anime({
  targets: 'div',
  borderTopLeftRadius: 0,
  borderTopRightRadius: 0,
  borderBottomRightRadius: 0,
  borderBottomLeftRadius: 0,
  direction: 'alternate',
  loop: true
});

@seleckis
Copy link

I see. But documentation is still confusing newbies. There is an example which does not work in FF.

@juliangarnier
Copy link
Owner

Ah good catch! I forgot to update the doc.
Will do in the next release.
Thanks!

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

5 participants