HackerReposA FIELD GUIDE TO OPEN SOURCE
ProSponsor the shelf♧ 0
← Back to top all-time
Modernizr
Modernizr
JavaScript2010–2026
Modernizr / Modernizr

Modernizr

Modernizr is a JavaScript library that detects HTML5 and CSS3 features in the user’s browser.

34Distinct people
36Mentions
0Explicit recommenders
25.7KGitHub stars
REPOSITORY AT A GLANCE

What to know before exploring

What it is

Modernizr is a JavaScript library that detects HTML5 and CSS3 features in the user’s browser.

GitHub

Where it is used

No documented product use was verified in the last source check.

What people are saying

No recommendation phrase was found in the indexed comments.

No classified warning is attached to this page. Read the discussions before treating silence as approval.

Also in these discussions

No other repository is repeatedly linked in the same discussions.

This week on Hacker News

Nov 7–Nov 14 UTC · Direct repository links and separately labeled related project stories. Indexed through 11/14/2026, 5:04:57 PM UTC.

No direct repository links were found in the indexed HN discussions over the past seven days. Older discussions are available below.

Mentions over time

HN mentions by year36 dated mentions

Observed mentions: 2010-05-14 16:56:41 UTC to 2026-01-05 05:19:41 UTC.

0369122010-01-01 00:00:00 UTC to 2011-01-01 00:00:00 UTC (exclusive): 4 mentions; 1 submissions, 3 comments20102011-01-01 00:00:00 UTC to 2012-01-01 00:00:00 UTC (exclusive): 6 mentions; 4 submissions, 2 comments2012-01-01 00:00:00 UTC to 2013-01-01 00:00:00 UTC (exclusive): 12 mentions; 6 submissions, 6 comments2013-01-01 00:00:00 UTC to 2014-01-01 00:00:00 UTC (exclusive): 3 mentions; 1 submissions, 2 comments2014-01-01 00:00:00 UTC to 2015-01-01 00:00:00 UTC (exclusive): 3 mentions; 1 submissions, 2 comments2015-01-01 00:00:00 UTC to 2016-01-01 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2016-01-01 00:00:00 UTC to 2017-01-01 00:00:00 UTC (exclusive): 1 mentions; 0 submissions, 1 comments2017-01-01 00:00:00 UTC to 2018-01-01 00:00:00 UTC (exclusive): 2 mentions; 1 submissions, 1 comments2018-01-01 00:00:00 UTC to 2019-01-01 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments20182019-01-01 00:00:00 UTC to 2020-01-01 00:00:00 UTC (exclusive): 1 mentions; 0 submissions, 1 comments2020-01-01 00:00:00 UTC to 2021-01-01 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2021-01-01 00:00:00 UTC to 2022-01-01 00:00:00 UTC (exclusive): 1 mentions; 0 submissions, 1 comments2022-01-01 00:00:00 UTC to 2023-01-01 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2023-01-01 00:00:00 UTC to 2024-01-01 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2024-01-01 00:00:00 UTC to 2025-01-01 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2025-01-01 00:00:00 UTC to 2026-01-01 00:00:00 UTC (exclusive): 1 mentions; 0 submissions, 1 comments2026-01-01 00:00:00 UTC to 2027-01-01 00:00:00 UTC (exclusive): 2 mentions; 0 submissions, 2 comments. Incomplete calendar period.2026*

* An incomplete calendar period is marked with an outlined bar. Its count is not directly comparable with a full period.

Counts come from the repository’s dated source evidence. Index cutoff: 2026-11-02 08:16:59 UTC.

View mention counts and date ranges
UTC ranges include their start and exclude their end. Select a period to filter the source evidence.
PeriodStart (UTC)End (exclusive, UTC)MentionsSubmissionsComments
20102010-01-01 00:00:00 UTC2011-01-01 00:00:00 UTC413
20112011-01-01 00:00:00 UTC2012-01-01 00:00:00 UTC642
20122012-01-01 00:00:00 UTC2013-01-01 00:00:00 UTC1266
20132013-01-01 00:00:00 UTC2014-01-01 00:00:00 UTC312
20142014-01-01 00:00:00 UTC2015-01-01 00:00:00 UTC312
20152015-01-01 00:00:00 UTC2016-01-01 00:00:00 UTC000
20162016-01-01 00:00:00 UTC2017-01-01 00:00:00 UTC101
20172017-01-01 00:00:00 UTC2018-01-01 00:00:00 UTC211
20182018-01-01 00:00:00 UTC2019-01-01 00:00:00 UTC000
20192019-01-01 00:00:00 UTC2020-01-01 00:00:00 UTC101
20202020-01-01 00:00:00 UTC2021-01-01 00:00:00 UTC000
20212021-01-01 00:00:00 UTC2022-01-01 00:00:00 UTC101
20222022-01-01 00:00:00 UTC2023-01-01 00:00:00 UTC000
20232023-01-01 00:00:00 UTC2024-01-01 00:00:00 UTC000
20242024-01-01 00:00:00 UTC2025-01-01 00:00:00 UTC000
20252025-01-01 00:00:00 UTC2026-01-01 00:00:00 UTC101
2026 (partial)2026-01-01 00:00:00 UTC2027-01-01 00:00:00 UTC202

From the project README

An excerpt from the repository, fetched Nov 13, 2026.

Read the project’s introduction
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: npm run serve-gh-pages and navigate to these two URLs: http://localhost:8080/test/unit.html http://localhost:8080/test/integration.html Integrating Modernizr with Build Tools This section provides guidance on how to integrate Modernizr with various build tools and frameworks, making it easier to use in your projects. 1. Integrating with Webpack To integrate Modernizr with Webpack, follow these steps: Install Modernizr: npm install modernizr --save Create a Modernizr Configuration File: Create a file named modernizr-config.js in your project root: module.exports = { "feature-detects": [ "test/feature1", "test/feature2", // Add more feature detects as needed ] }; Update Webpack Configuration: Modify your Webpack configuration file (e.g., webpack.config.js) to include the Modernizr plugin: const ModernizrWebpackPlugin = require('modernizr-webpack-plugin'); module.exports = { // Other configurations... plugins: [ new ModernizrWebpackPlugin({ "feature-detects": [ "test/feature1", "test/feature2" ] }) ] }; Build Your Project: Run your Webpack build process: npm run build 2. Integrating with Gulp If you are using Gulp, you can integrate Modernizr as follows: Install Modernizr: npm install modernizr --save-dev Create a Gulp Task: In your gulpfile.js, add a task to build Modernizr: const gulp = require('gulp'); const modernizr = require('modernizr'); gulp.task('modernizr', function() { return modernizr.build({ "feature-detects": [ "test/feature1", "test/feature2" ] }).pipe(gulp.dest('dist/')); }); Run the Gulp Task: Execute the task to generate the Modernizr build: gulp modernizr 3. Integrating with Parcel For projects using Parcel, you can integrate Modernizr as follows: Install Modernizr: npm install modernizr --save Create a Modernizr Configuration File: Similar to the Webpack setup, create a modernizr-config.js file: module.exports = { "feature-detects": [ "test/feature1", "test/feature2" ] };
Read the full README on GitHub

What Hacker News says

36 sources
I love flexbox. But be aware what it's a beast which is not that super-well supported as you might think when you look it up in caniuse. When I'm fixing cross-browser bugs nowadays it's mostly about flexbox. It's not very often and I can always fix it in a small amount of time. But it gives me an unpleasant but also nostalgic flashback of the old days in the 00s where I fixed more CSS than I originally developed. So yes, from time to time I run into different and not so obvious problems. My holy grail to work with flexbox today is this list: https://github.com/philipwalton/flexbugs Two recent issues I ran into: There is a very nasty "bug" in the current Firefox browser. It's not a real bug- more a different interpretation of the standard which will hit any developer not working primarily with Firefox I guess. It's about the intrinsic si
Read the rest
ze of a flex item in combination with fluid images. You have to apply min-width: 0 to the flex-item or you get a (very) wrong sizing in some circumstances. See [2] and [3] And another one. Most of the time I think about IE11 that it's a mostly 'modern' browser and therefore supports flexbox very good. Yes it is good enough to use. But don't underrate the flexbox bugs (just glimpse through [1]). For example you have to set `min-height > 1px` on a flex container to prevent it from collapsing in some scenario (holy grail layout is a very common case). See here [4] [1] https://github.com/philipwalton/flexbugs [2] https://bugzilla.mozilla.org/show_bug.cgi?id=1108514 [3] https://github.com/philipwalton/flexbugs/issues/41 [4] https://github.com/Modernizr/Modernizr/issues/1301
In How well do you know CSS display?
The author dismisses feature detection as being "slow", but it's much less error prone: http://www.stucox.com/blog/using-webp-with-modernizr/ You can just cache the result in localStorage; you take a few-millisecond hit once. Here's how the feature detection is done: https://github.com/Modernizr/Modernizr/blob/924c7611c170ef2d... HOWEVER, in this case (webp), it's likely better to detect it on the server: https://github.com/igrigorik/webp-detect (More info: http://www.stucox.com/blog/client-side-vs-server-side-detect...) The only time you really should be looking at the User Agent is if you're trying to do something like show a "Download for (Chrome|Firefox|etc)" button.
In Why Parse the User Agent?
Nah, it's not that. I can't get it working either and WebGL is working fine here. They're using Modernizr and the 'Modernizr.csstransforms3d' property seems to be returning false in my browser. Maybe it's because of this bug? https://github.com/Modernizr/Modernizr/issues/590 Edit: actually, it does seems to be a blacklisting issue. You can check in about:gpu. In my case I was running WebGL via software! If you're curious you can see the full list here: https://dl.google.com/dl/edgedl/chrome/gpu/software_renderin...
In Microsoft brings 18-year-old game 'Hover' to browser

Showing the 15 most recent of 36 sources. Enable JavaScript to search and browse every indexed mention.

MAKE YOURSELF AT HOME

A few shortcuts

/
Search the collection
?
Open this guide
Esc
Close dialogs and navigation

Your saved repositories and interests stay in this browser.