On this page
Installing Modernizr module and JavaScript library
Drupal 7 will no longer be supported after January 5, 2025. Learn more and find resources for Drupal 7 sites
Modernizr is not GPLv2, and therefore cannot ship within Drupal modules. Since the Modernizr module depends on the upstream JavaScript library, you cannot simply enable the module and expect it to work. Just like a WYSIWYG module or jQuery Update, you must upload your own copy of the JS file after uploading the module to your server.
Drush (easiest)
The best and easiest way to install Modernizr is to use drush, the command-line tool for Drupal.
drush en modernizr -y
This will enable the Modernizr module and automatically download a development copy of modernizr.js. If you'd like to replace your current file, delete it and run the following command:
drush mdl
Drush can detect whether or not you're using the Libraries API and place the file in the correct location within your Drupal codebase: sites/all/libraries/modernizr
Without Drush
If you are unable or unwilling to use Drush, you'll have to go to modernizr.com, get the file from the site, and upload it to sites/all/libraries/modernizr
Help improve this page
You can:
- Log in, click Edit, and edit this page
- Log in, click Discuss, update the Page status value, and suggest an improvement
- Log in and create a Documentation issue with your suggestion