user81993
user81993

Reputation: 6603

Are the -webkit or -moz or whatever properties really necessary?

I wanted to put box shadow on an element, this time instead of filling the parameters manually, I used an online generator which gave me an output like this:

-webkit-box-shadow: 0px 10px 7px -8px rgba(0,0,0,0.25);
-moz-box-shadow: 0px 10px 7px -8px rgba(0,0,0,0.25);
box-shadow: 0px 10px 7px -8px rgba(0,0,0,0.25);

But its just the same thing 3 times over, I'd get it if there were some parametric differences between different browser implementations but in this case there aren't any. Also, just plain old

box-shadow: 0px 10px 7px -8px rgba(0,0,0,0.25);

works in all modern browsers anyway so why would I want to bloat my css file?

Upvotes: 0

Views: 100

Answers (2)

Jinx
Jinx

Reputation: 358

It depends on your asnwer to question;

Should my web app work on older browsers?

  • Yes!

Use the vendors, but consider some tools which will do it for you. Check: https://github.com/postcss/autoprefixer

  • No:)

But are you sure? Some users use PCs in their work with Windows Vista and IE10 and they cannot change it becouse of license and boss politics.

Upvotes: 0

Quentin
Quentin

Reputation: 943142

Are the -webkit or -moz or whatever properties really necessary?

Do you want to use experimental / unstable / non-standard CSS properties that are at the bleeding edge of support in the browsers they appear in?

Then yes.

Do you want to use stable, standard CSS properties that have had their specs finalised and will only work in browsers that think they have a robust implementation?

Then no.


And related to that — "Is box-shadow 'experimental / unstable / non-standard'"?

See the support chart: Not these days.

Upvotes: 4

Related Questions