Why is it not recommended to use a polyfill for CSS3 selector support?
I need to ensure IE7 and IE8 support.
I'm using a few CSS3 selectors like
:last-child. I dropped in Selectivizr, and it appears to fix many problems in those browsers, leaving me just a handful to clean up with some fallback code.
But HTML5 Please recommends using only fallbacks, not polyfills, to address CSS3 selector support:
We strongly recommend you do not try to polyfill this, but if you do need one, you can use Selectivizr.
It would be good to know why they "strongly recommend" against polyfills here... Anyone have any ideas?
Using a fallback I think means you should be adding classes to the elements that you cannot select with modern selectors like adding
.first to be used for
:checked, and so on.
But in my humble opinion, Selectivizr is a piece of magic that will teach IE6-8 to behave and ensure your HTML is clean from unnecessary classes and will shorten your development time.
This post first appeared on CSS3 Recipes - The Solution To All Your Style Problems, please read the originial post: here