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 advance
12 Replies
Jochem
Jochem3mo ago
caniuse.com or just use postcss and with autoprefixing
ἔρως
ἔρως3mo ago
mdn also says when you should use prefixes
Jochem
Jochem3mo ago
and also, finally, testing
ἔρως
ἔρως3mo ago
yup, but autoprefix should be enough, if setup properly
snxxwyy
snxxwyyOP3mo ago
At okay I see, thanks. Is there any sort of rule of thumb for it?
Jochem
Jochem3mo ago
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
ἔρως
ἔρως3mo ago
the non rule of thumb is "good luck!!!"
Jochem
Jochem3mo ago
basically, don't waste your life writing prefixes by hand, either don't use them at all or have postcss do it for you
ἔρως
ἔρως3mo ago
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
capt_uhu
capt_uhu3mo ago
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.
ἔρως
ἔρως3mo ago
-webkit-css
snxxwyy
snxxwyyOP3mo ago
i'll take a look into the autoprefixer then, thanks for the tips everyone
Want results from more Discord servers?
Add your server