Why are CSS3 PIE and other similar scripts not in use everywhere?

前端 未结 1 1114
鱼传尺愫
鱼传尺愫 2021-01-03 05:42

This question has already been asked at htc files: Why not to use them?, but the answer didn\'t answer anything really.

The question is, why is something like CSS3 P

相关标签:
1条回答
  • 2021-01-03 06:37

    I can't speak for everyone, but my sense is that you don't see tools like these in use on large sites because:

    1) They do incur a certain performance cost. CSS3 PIE in particular starts to create a noticeable rendering delay after use on about two dozen elements (in my experience, YMMV.) For that reason its use on large pages might cause a larger rendering delay than the time saved downloading image assets.

    2) They start to show bugs with complex DOM changes. Lots of animation, showing/hiding, etc. can sometimes cause PIE to get out of sync.

    3) Related to #2, the added layer of abstraction (and its associated bugs) can become a detriment on large development teams with a complex codebase. If you start spending more time debugging the abstraction than it would take to simply create rounded corner images, then the tool is getting in the way.

    I'm speaking specifically about CSS3 PIE here because it's near and dear to me (I'm its creator), but similar caveats apply to other polyfills like Selectivizr. This goes for any tool: you always have to evaluate the pros/cons for your specific needs. For example I wouldn't recommend PIE for a high-traffic, performance-critical, highly interactive site like Twitter for the reasons stated above, but it really shines on simpler more static designs.

    ...Another thought is that it's perfectly valid in many cases to simply let IE degrade to square corners etc. This is always the preferred approach IMO, if possible given your particular situation. So in that case it's not due to any evaluation of the tool, but just a decision that what the tool provides is simply not needed in the first place. :)

    0 讨论(0)
提交回复
热议问题