AGamePlayer
AGamePlayer

Reputation: 7736

How necessary is it to keep these "-webkit-" "-moz-" "-o-" "-ms-" prefix nowadays? (As of Dec 2019)

I saw many CSS codes like:

  -webkit-transition: all 0.3s ease-out;
  -moz-transition: all 0.3s ease-out;
  -o-transition: all 0.3s ease-out;
  -ms-transition: all 0.3s ease-out;
  transition: all 0.3s ease-out;

I am just wondering, is it still necessary to keep those four properties with prefixes?

If I don't need to serve users on very ancient devices, can I just drop them?

Thanks

Upvotes: 2

Views: 1464

Answers (1)

theMayer
theMayer

Reputation: 16167

What is a vendor prefix?

Simply put, a vendor prefix allows you to utilize experimental CSS features which have been implemented in one or more browsers, but are not currently mainstream.

Should you use vendor prefixes?

This comes down to a matter of opinion, but the opinion of the W3C is "no, you should not."

Official W3C policy states that you shouldn’t really use experimental properties in production code, but people do, as they want to make sites look cool and keep on the cutting edge.
- W3C page on optimizing content for different browsers

Personally, I would never accept CSS into my codebase if the developer used vendor prefixes. It automatically creates a maintenance issue. If you insist on using experimental CSS features in production code, then you should probably use a utility such as autoprefixer during your build.

Upvotes: 1

Related Questions