What is Modernizr and Why use it?
August 19, 2015 . Browser Support . Comments
Polyfill + Modernizr
Polyfill is a piece of code which certain browsers are lacking, For example -- IE6 not supporting local storage feature. But does that mean that we wait untill everybody in world moves to latest browser so that we can start using awesome HTML5, ES6, or CSS3 features??? No, Solution is simple, developers write polyfills which mimics the lacking features in older browsers. Using polyfills now you can use this awesome features wihout worrying about unhappy users.
But Polyfill is javascript code. More javascript files you load slower your page will be.
Hmm, Well there is better way, Wouldn't it be better if we could check if my browser can support certain features or not?
Also wouldn't it be better if we only loaded the polyfill javascript file if my browser does not support certain feature.
Use Modernizr my friend.
Understand by Example
In Conclusion
Rememeber polyfills can be written for missing CSS, HTML or Javascript functionalities. Its best way to keep utilizing latest features of modern browsers.
Here is very helpful link for many polyfills : Polyfills
NOTE: Learn about Modernizr for easy Polyfilling
Comments Section
Feel free to comment on the post but keep it clean and on topic.