A UI-focused entry in TopGit's GitHub warehouse: Modernizr/Modernizr, 25.7k stars, Frontend, JavaScript. Modernizr is a JavaScript library that detects HTML5 and CSS3 features in the user’s browser.
Snapshot summary built from the project's own GitHub metadata — there's no written TopGit review yet. The page will update automatically when a full review is published.
WHY NO REVIEW YET
TopGit writes full reviews for the most-starred, most-requested repositories. This page is a snapshot until then — see the READ ME tab for the original README in full.
Modernizr is a JavaScript library that detects HTML5 and CSS3 features in the user’s browser.
Read this file in Portuguese-BR here
Read this file in Indonesian here
Read this file in Spanish here
Read this file in Swedish here
Read this file in Tamil here
Read this file in Kannada here
Read this file in Hindi here
Our Website is outdated and broken, please DO NOT use it (https://modernizr.com) but rather build your modernizr version from npm.
Documentation
Integration tests
Unit tests
Modernizr tests which native CSS3 and HTML5 features are available in the current UA and makes the results available to you in two ways: as properties on a global Modernizr object, and as classes on the <html> element. This information allows you to progressively enhance your pages with a granular level of control over the experience.
Breaking changes with v4
Dropped support for node versions <= 10, please upgrade to at least version 12
Following tests got renamed:
class to es6class to keep in line with the rest of the es-tests
Following tests got moved in subdirectories:
cookies, indexeddb, indexedblob, quota-management-api, userdata moved into the storage subdirectory
audio moved into the audio subdirectory
battery moved into the battery subdirectory
canvas, canvastext moved into the canvas subdirectory
customevent, eventlistener, forcetouch, hashchange, pointerevents, proximity moved into the event subdirectory
exiforientation moved into the image subdirectory
capture, fileinput, fileinputdirectory, formatattribute, input, inputnumber-l10n, inputsearchevent, inputtypes, placeholder, requestautocomplete, validation moved into the input subdirectory
svg moved into the svg subdirectory
webgl moved into the webgl subdirectory
Following tests got removed:
touchevents: discussion
unicode: discussion
templatestrings: duplicate of the es6 detect stringtemplate
contains: duplicate of the es6 detect es6string
datalistelem: A dupe of Modernizr.input.list
New Asynchronous Event Listeners
Often times people want to know when an asynchronous test is done so they can allow their application to react to it.
In the past, you've had to rely on watching properties or <html> classes. Only events on asynchronous tests are
supported. Synchronous tests should be handled synchronously to improve speed and to maintain consistency.
The new API looks like this:
// Listen to a test, give it a callback
Modernizr.on("testname", function (result) {
if (result) {
console.log("The test passed!");
} else {
console.log("The test failed!");
}
});
We guarantee that we'll only invoke your function once (per time that you call on). We are currently not exposing
a method for exposing the trigger functionality. Instead, if you'd like to have control over async tests, use the
src/addTest feature, and any test that you set will automatically expose and trigger the on functionality.
Getting Started
Clone or download the repository
Install project dependencies with npm install
Building Modernizr
From javascript
Modernizr can be used programmatically via npm:
var modernizr = require("modernizr");
A build method is exposed for generating custom Modernizr builds. Example:
var modernizr = require("modernizr");
modernizr.build({}, function (result) {
console.log(result); // the build
});
The first parameter takes a JSON object of options and feature-detects to include. See lib/config-all.json for all available options.
The second parameter is a function invoked on task completion.
From the command-line
We also provide a command line interface for building modernizr.
To see all available options run:
./bin/modernizr
Or to generate everything in 'config-all.json' run this with npm:
npm start
//outputs to ./dist/modernizr-build.js
Testing Modernizr
To execute the tests using mocha-headless-chrome on the console run:
npm test
You can also run tests in your browser of choice with this command:
Update Parcel Configuration:
You can use a plugin like parcel-plugin-modernizr to integrate Modernizr:
npm install parcel-plugin-modernizr --save-dev
Build Your Project:
Run Parcel to build your project:
parcel build index.html
Conclusion
Integrating Modernizr with your build tools can enhance your web applications by allowing you to detect and respond to the capabilities of the user's browser. Follow the steps above to set up Modernizr with your preferred build tool.
For more information, refer to the Modernizr documentation.
Code of Conduct
This project adheres to the Open Code of Conduct.
By participating, you are expected to honor this code.
The most recent commit recorded on Modernizr/Modernizr was 3 months ago, based on the GitHub push timestamp. The repository has 2.9k forks — one of the better signals of community interest.
How many stars does Modernizr/Modernizr have?
Modernizr/Modernizr has 25.7k GitHub stars — refresh the page for the live number, or check github.com/Modernizr/Modernizr. TopGit mirrors GitHub's count but does not claim minute-by-minute accuracy.
What language is Modernizr/Modernizr written in?
Modernizr/Modernizr is written primarily in JavaScript. GitHub's language field is based on the largest share of bytes in the default branch.
What license does Modernizr/Modernizr use?
Modernizr/Modernizr is released under the MIT license. Always verify the LICENSE file directly on GitHub for the authoritative terms — license strings can be edited out of sync with a project's actual stance.
What topics is Modernizr/Modernizr associated with?
GitHub's repository topics for Modernizr/Modernizr: "css3-features", "feature-detection", "hacktoberfest", "javascript", "javascript-library", "modernizr". TopGit's editorial category is Frontend.
Where can I see Modernizr/Modernizr in action?
The project maintains a homepage at https://www.npmjs.com/package/modernizr. The README tab on this page also usually contains screenshots and a quickstart.
Where do I read more about Modernizr/Modernizr?
This TopGit page is a snapshot — the READ ME tab shows the project's own README content (links stripped, images preserved). The GitHub repository at github.com/Modernizr/Modernizr is the definitive source.
Read full README in the tab above.
Curious whether Modernizr is right for you?
Let ChatGPT, Claude, or Perplexity look into it — click below and see what AI actually says about Modernizr.