Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is CSS's efficiency with text-shadow as bad as box-shadow?

I have noticed in my many years of web design that CSS's box shadow is enormously expensive with resources and causes many old phones to lag severely; but is that is the case with text-shadow? When is it okay to use text-shadow, and how is it rendered?

like image 532
Joshua Sandoval Avatar asked Oct 05 '15 12:10

Joshua Sandoval


People also ask

How is the box-shadow different from text shadow?

With CSS3 you can create two types of shadows: text-shadow (adds shadow to text) and box-shadow (adds shadow to other elements).

What is the impact of negative value of h shadow under text property of text shadow?

A negative horizontal length value places the shadow to the left of the text. Specifies the vertical distance below the text. A negative vertical length value places the shadow above the text.

What is the difference between drop-shadow and box-shadow?

they achieve different things. but as an advantage with filter:drop-shadow you can generate shadow around irregular shapes or images, whereas box-shadows generates a rectangular shadow. as you can see , with drop-shadow the pseudo-element also has a shadow around it, whereas with box-shadow it does not.

What is the value of text shadow?

Each shadow is specified as two or three <length> values, followed optionally by a <color> value. The first two <length> values are the <offset-x> and <offset-y> values. The third, optional, <length> value is the <blur-radius> . The <color> value is the shadow's color.


1 Answers

CSS's box shadow is enormously expensive with resources and causes many old phones to lag severely; but is that is the case with text-shadow?

I guess the short answer is yes: text-shadow is expensive for the same reasons box-shadow is.

It looks like this article confirms that text-shadow can cause performance issues: http://codeincomplete.com/posts/2011/8/11/noglow/.

There is also this question that seems related and has an accepted answer: text-shadow (and other css3) causes scroll lag.

When is it okay to use text-shadow

I guess this depends on your audience and wether they have powerful enough hardware.

…and how is it rendered?

This seems to ask for implementation details which are probably browser/platform-specific, …and probably irrelevant to the question for the most part. :)

like image 108
Vlad GURDIGA Avatar answered Oct 08 '22 00:10

Vlad GURDIGA