| I have mixed feelings on Modernizr...but this post seems to be filled with a number of weak points. First, the Modernizr file ends in ".js" I don't think anybody is fooled about how it works and what its consequences are. Second, the advocated method of stying your site with Modernizr is to first make it look good assuming no "advanced features" exist and then progressively enhance. This ensures that the failure of Modernizr to load will leave you with what you started with. Given that the Modernizr classes are added to the root of your document this claim seems impossible: "However, it also means there is a significant loss in the overall structure of specificity within your stylesheets, which could easily cascade unintended effects through to other elements." Finally his core argument is that Modernizr violates the separation of concerns in front-end web development. This is true and something that you have to be willing to accept to use it. His proposed alternatives are strange however. He suggests server-side browser sniffing, a bad idea as the article itself explains. Alternatively he suggests using CSS cascading, but this is a bit of a tautology since this is the problem Modernizr was designed to solve. My personal opinion is that Modernizr is a bit of a kludge, but often the least ugly option available. |
I think the big problem and why separation of concerns matters is that people don't design a site once and then let it be. Most frontend developers maintain already existing sites, across new features, new browser versions and new end user expectations. You can't apply that "advocated method" there, or at least you can't do so equally well.
I guess that simply disabling Modernizr when adding new design elements until things are good enough, and then enabling it for the "advanced features" could be a work around. I've yet to see such a disciplined workflow somewhere, however.
Nevertheless, I agree with you that it's the least ugly option available. Maybe making it easier for a developer to temporarily disable modernizr helps styling with the "prefer good styling with no advanced features" approach.