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

backgroundClip property not applying on Webkit browsers #1014

Closed
buzzb0x opened this issue Jul 5, 2018 · 2 comments
Closed

backgroundClip property not applying on Webkit browsers #1014

buzzb0x opened this issue Jul 5, 2018 · 2 comments

Comments

@buzzb0x
Copy link

buzzb0x commented Jul 5, 2018

The problem

Trying to apply the property background-clip with the value text fails on WebKit based browsers. Also, it is unclear how to enforce vendor prefixes when they are wanted. For example, here, on Firefox, using WebkitBackgroundClip is unsuccessful, but -webkit-backgroundClip and -webkit-background-clip work.

How to reproduce

Simplified test case: https://codesandbox.io/s/p99rr7nwvm

Failure screenshot: https://screenshots.firefox.com/vCQq2udOPaIZgnlK/codesandbox.io

Success screenshot: https://screenshots.firefox.com/hoAGK4Q8c03EUgl1/codesandbox.io

Steps to reproduce:

  1. Create a Text element
  2. Apply styling that uses the backgroundClip property
  3. Watch it fail on Chrome, Safari, but not on Firefox

Expected behavior

I frankly expected it to prefix it and apply it correctly on all browsers, as that is what the documentation suggests.

Environment (include versions). Did this work in previous versions?

  • React Native for Web (version): 0.8.6
  • React (version): 16.4.1
  • Browser: Firefox 60, Chrome 67,

I'm using React Native Web to create a website, I develop in React Native so it's easier for me. Wouldn't it also be useful to be able to directly specify custom CSS styling to a component?

@necolas
Copy link
Owner

necolas commented Jul 5, 2018

If there's a problem with prefixing the property it will lie upstream here: https://github.com/rofrischmann/inline-style-prefixer. You should also know that background is not a supported property.

@necolas
Copy link
Owner

necolas commented Jul 5, 2018

Your example has a few issues. Once fixed it works correctly:

  1. Use backgroundImage instead of background (see the docs for supported View styles).
  2. Use color instead of WebkitFillColor.
  3. Use the W3C linear-gradient syntax.
  4. Upgrade the RNW dependency to 0.8.x.

@necolas necolas closed this as completed in 4151b47 Jul 5, 2018
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

2 participants