Search code examples
asp.netasp.net-mvcmodernizr

Is Modernizr required/used by other packages by default?


Is the Modernizr required by jQuery, Bootstrap? I seen this nuget package in many MVC.ASP 4.7 projects and just tried to create a new project where it is automatically added. I never used it and I wonder if I can just remove it?


Solution

  • Modernizr is a small, simple and open-source JavaScript library that helps us to take advantage of emerging web technologies; HTML5 and CSS3 maintain the look and feel for older browsers that may not yet support these new technologies.

    If you create an ASP.NET MVC Web Application, you get this library by default and by expanding the "Scripts" folder.

    Modernizr does three things basically.

    1. It adds classes indicating feature support.
    2. It allows to run feature detection to decide whether to run a script.
    3. It injects html5shiv for allows old browsers to understand HTML5 elements.

    If you don't use any of these features, then there's no point in including Modernizr at all.