iOS Development

“filter” css property not engaged on SVG in iOS 17

I’m going through a difficulty with the filter css property utilized on SVG on not too long ago launched IOS17. The filter: invert(1) works accurately in IOS 16 and under. Validated this in each browserstack and actual gadget as nicely.

The svg emblem and filter css type has been there for a very long time and it’s working advantageous on all of the OS and units aside from iOS 17. The filter: invert(1) css is added conditionally, based mostly on the background of the net web page. I attempted including -webkit-filter types as nicely to see whether or not it really works, but it surely would not.

You’ll be able to run this codepen containing the instance for a similar: https://codepen.io/rajeshprabhu879/pen/yLZBKQq

Run that is IOS17 and IOS16 (or much less) and you will see the distinction

Under is the instance snippet –

HTML


 <div class="container">
    <svg xmlns="http://www.w3.org/2000/svg" width="2036" top="2500" viewBox="0 0 456.008 560.035"><path d="M380.844 297.529c.787 84.752 74.349 112.955 75.164 113.314-.622 1.988-11.754 40.191-38.756 79.652-23.343 34.117-47.568 68.107-85.731 68.811-37.499.691-49.557-22.236-92.429-22.236-42.859 0-56.256 21.533-91.753 22.928-36.837 1.395-64.889-36.891-88.424-70.883-48.093-69.53-84.846-196.475-35.496-282.165 24.516-42.554 68.328-69.501 115.882-70.192 36.173-.69 70.315 24.336 92.429 24.336 22.1 0 63.59-30.096 107.208-25.676 18.26.76 69.517 7.376 102.429 55.552-2.652 1.644-61.159 35.704-60.523 106.559M310.369 89.418C329.926 65.745 343.089 32.79 339.498 0 311.308 1.133 277.22 18.785 257 42.445c-18.121 20.952-33.991 54.487-29.709 86.628 31.421 2.431 63.52-15.967 83.078-39.655"/></svg>
</div>

CSS

.container svg {
  width: 100%;
  top: 100%;
  -webkit-filter: invert(1);
  filter: invert(1);
}

iOS 17

iOS 16

Credit: www.ismmailgsm.com

Leave a Reply

Your email address will not be published. Required fields are marked *

Back to top button