anandthakker / doiuse

:bomb: Lint CSS for browser support against caniuse database.
MIT License
1.24k stars 51 forks source link

Hide prefixed css? #91

Closed ShaggyDude closed 1 year ago

ShaggyDude commented 6 years ago

'-webkit-appearance: button;' is giving a warning 'CSS Appearance not supported by: IE (11)'. Shouldn't this be hidden because '-webkit' only applies to webkit?

Nemo64 commented 6 years ago

It isn't really obvious what the right behaviour is. Technically, -webkit only works in webkit browser so it should complain at any none webkit browser.

ShaggyDude commented 6 years ago

No I think it should not complain at all. Anyone typeing -webkit knows they are doing something for webkit only. anything that is autoprefixed -webkit is something that is supported?

Nemo64 commented 6 years ago

But the point of this tool is to tell you what browsers are supported by your stylesheet. Since you use webkit specific properties your stylesheet is only supported by webkits ~ and similar.

If you need exceptions for progressive enhancement or fixing a browser specific bug you have /* doiuse-disable feature */. Then it is also clear from your stylesheet that you avoided a test.

dumblob commented 4 years ago

I think the main issue here is, that after running Autoprefixer, you want to know just about "what's left" (as Autoprefixer denied implementing such reporting functionality in favor of doiuse).

@ai thoughts?

ai commented 4 years ago

Users need to write hacks with prefixes even with Autoprefixer, so I think doiuse it will be good to avoid warning for prefixed properties

clshortfuse commented 1 year ago

Anyone typeing -webkit knows they are doing something for webkit only. anything that is autoprefixed -webkit is something that is supported?

Kinda. For example, Firefox supports -webkit-box-clamp : https://caniuse.com/?search=line-clamp

As an author, I would like to know what my -webkit-* isn't going to work on the browsers I listed. And I'd be happy to know that browsers beside -webkit also support the syntax. If all my supported browsers pass then I'm good. But if one of the fails, then I have to ignore the rule and script some workaround. (I do this for -webkit-mask-image for example.)

This shows that prefixes are not really related to the browsers anymore. That also means we can't just say "Don't show webkit errors on Firefox`.