P
P
picka2021-07-04 02:33:56
React
picka, 2021-07-04 02:33:56

How to solve filter:drop-shadow rendering problem in React?

I'm currently developing a Next.js application that mostly has filter: drop-shadow - it helps me create a neon glow for SVG elements.

Problem : as I understand it, on mobile devices, browsers do not have enough power to render all elements with this style, and at the end of the load I get a simple crash of the site.

Question : Can anyone suggest a solution to this problem? Analogous solutions like: transfer all SVG to a font and use text-shadow is not very suitable. I would like to find a solution by optimizing the rendering process itself, if possible. Can someone post articles or show examples?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Anton Romankov, 2021-07-08
@romant094

I would recommend replacing it with box-shadow on mobile because the performance drawdown will be severe if the browser doesn't support it.
Here it is described when it is better to use what.
https://css-tricks.com/breaking-css-box-shadow-vs-...
UPD see which browsers you need to support and decide whether to use it or not.
https://caniuse.com/?search=drop-shadow

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question