mercredi 22 juin 2016

Modernizr.js is (becoming) obsolete. Other solutions?


Browsers keep advancing together. That is to say, the latest and greatest (e.g., ie11+, Edge, Chrome, Safari, Firefox, etc), are, more and more, keeping step with each other. What renders in, say, Chrome, will now render the same in, say, Microsfot Edge.

And with this new trend, Modernizr doesn't seem to really help me much. In fact, I used to "boilerplate" it in my stack, but now I just leave it out. Why create another http request and/or a bigger overall site file size for something you don't use?

If you go to the "Can I Use" site and type in, say, "flexbox" http://caniuse.com/#search=flexbox. It will show you that, technically-speaking, ie11 and Chrome support this feature.

And if you use Modernizer, it will add a flexbox class to the HTML tag in ie11, Chrome, etc....But, this flexbox-based sticky footer, for example, by Philip Walton: https://philipwalton.github.io/solved-by-flexbox/demos/sticky-footer is basically broken in ie11, but works great in everything else. In other words, though these browser render the css significantly different...modernizer is still irrelevant.

I'm finding this more and more to be the case with modern browsers. Modernizer doesn't help, unless there is really a huge difference in browser version or type (e.g., ie7 vs, say, ie11). But even Microsoft has stopped support ie10 and below now (https://www.microsoft.com/en-us/WindowsForBusiness/End-of-IE-support. That is to say, for most dev shops, you won't be asked to support ie7 or ie8, etc. anyway.

So, for now, I have to rely on css "hacks" where I try and use CSS to target specific browsers like so: http://browserhacks.com.

Bottom line: it seems to me that modernizer is (becoming) obsolete for modern browser development...yet browsers still don't do things exactly the same. We need a new solution or we just need to accept that "hacks" are the new standard.

Thoughts?


Aucun commentaire:

Enregistrer un commentaire