iOS Development

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

Spread the love


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 properly.

The svg brand and filter css fashion has been there for a very long time and it’s working positive on all of the OS and gadgets aside from iOS 17. The filter: invert(1) css is added conditionally, primarily based on the background of the net web page. I attempted including -webkit-filter kinds as properly to see whether or not it really works, however it does not.

You may 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 may see the distinction

Under is the instance snippet –

HTML


 <div class="container">
    <svg xmlns="http://www.w3.org/2000/svg" width="2036" peak="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%;
  peak: 100%;
  -webkit-filter: invert(1);
  filter: invert(1);
}

iOS 17

iOS 16

Is anyone going through the identical downside with iOS 17. What adjustments would I have to do to make it work in iOS 17 as properly (in fact not breaking in earlier variations as properly) ?

Leave a Reply

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