Prefixes (e.g. -webkit-xyz)
Hey, how do you know when you should you use prefixed properties such as
-webkit
? Is it when a property you write doesn’t work in a certain browser? Then you’d use that browser’s prefix on it?
Thanks in advance12 Replies
caniuse.com or just use postcss and with autoprefixing
mdn also says when you should use prefixes
and also, finally, testing
yup, but autoprefix should be enough, if setup properly
At okay I see, thanks. Is there any sort of rule of thumb for it?
the rule of thumb is "use an autoprefixer"
though I generally just don't use features until they're usable unprefixed, it's not nearly as much of a wait or an issue as it used to be
the non rule of thumb is "good luck!!!"
basically, don't waste your life writing prefixes by hand, either don't use them at all or have postcss do it for you
there are very specific properties, like
-webkit-tap-color
or whatever it is
-webkit-tap-highlight-color
- this only exists for chrome
and yes, it is something you want to use, to remove the ugly blue thing
and there is also -moz-osx-font-smoothing
FYI, we are trying through the interop process to get some prefixed properties cross browser compatible and unprefixed every year. It's just a long slow process.... Agreed that for now we should probably just officially duct tape a small autoprefixer logo to the bottom right corner of the CSS logo.
-webkit-css
i'll take a look into the autoprefixer then, thanks for the tips everyone