All Projects → Modernizr → Modernizr

Modernizr / Modernizr

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

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to Modernizr

Simpletones.js
The goal of simpleTones.js is to provide every JavaScript developer with a lightweight solution for creating custom sounds in their web applications. This documentation has been written in hopes that the least experienced developer can read, understand and go on to do great things. You can check out several examples at this link:
Stars: ✭ 45 (-99.82%)
Mutual labels:  hacktoberfest, javascript-library
Rhino3dm
Libraries based on OpenNURBS with a RhinoCommon style
Stars: ✭ 232 (-99.08%)
Mutual labels:  hacktoberfest, javascript-library
Jschema
A simple, easy to use data modeling framework for JavaScript
Stars: ✭ 261 (-98.96%)
Mutual labels:  hacktoberfest, javascript-library
Openfoodnetwork
Connect suppliers, distributors and consumers to trade local produce. We're recruiting paid contributors, link below.
Stars: ✭ 682 (-97.28%)
Mutual labels:  hacktoberfest
Testing Nestjs
A repository to show off to the community methods of testing NestJS including Unit Tests, Integration Tests, E2E Tests, pipes, filters, interceptors, GraphQL, Mongo, TypeORM, and more!
Stars: ✭ 685 (-97.27%)
Mutual labels:  hacktoberfest
Progressively
A JavaScript library to load images progressively 🌇
Stars: ✭ 691 (-97.25%)
Mutual labels:  javascript-library
Rich
Rich is a Python library for rich text and beautiful formatting in the terminal.
Stars: ✭ 31,664 (+26.14%)
Mutual labels:  hacktoberfest
Vscode Styled Components
Syntax highlighting for styled-components
Stars: ✭ 680 (-97.29%)
Mutual labels:  hacktoberfest
H1st
The AI Application Platform We All Need. Human AND Machine Intelligence. Based on experience building AI solutions at Panasonic: robotics predictive maintenance, cold-chain energy optimization, Gigafactory battery mfg, avionics, automotive cybersecurity, and more.
Stars: ✭ 697 (-97.22%)
Mutual labels:  hacktoberfest
Wg Ui
WireGuard Web UI for self-serve client configurations, with optional auth.
Stars: ✭ 690 (-97.25%)
Mutual labels:  hacktoberfest
Mali
A minimalistic gRPC microservice framework for Node.js
Stars: ✭ 689 (-97.26%)
Mutual labels:  hacktoberfest
Mailthief
A fake mailer for Laravel Applications for testing mail.
Stars: ✭ 687 (-97.26%)
Mutual labels:  hacktoberfest
Node Red Nodes
Extra nodes for Node-RED
Stars: ✭ 693 (-97.24%)
Mutual labels:  hacktoberfest
Tslint To Eslint Config
Converts your TSLint configuration to the closest possible ESLint equivalent. 🚀
Stars: ✭ 680 (-97.29%)
Mutual labels:  hacktoberfest
Mevn Cli
Light speed setup for MEVN(Mongo Express Vue Node) Apps
Stars: ✭ 696 (-97.23%)
Mutual labels:  hacktoberfest
Querido Diario
📰 Brazilian government gazettes, accessible to everyone.
Stars: ✭ 681 (-97.29%)
Mutual labels:  hacktoberfest
Offix
GraphQL Offline Client and Server
Stars: ✭ 694 (-97.24%)
Mutual labels:  hacktoberfest
Shellhub
💻 ShellHub enables teams to easily access any Linux device behind firewall and NAT.
Stars: ✭ 686 (-97.27%)
Mutual labels:  hacktoberfest
Contribute To Open Source
Learn the GitHub workflow by contributing code in a fun simulation project
Stars: ✭ 684 (-97.28%)
Mutual labels:  hacktoberfest
Linq.ts
🌀LINQ for TypeScript
Stars: ✭ 687 (-97.26%)
Mutual labels:  hacktoberfest

Modernizr

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

npm version Build Status codecov Inline docs

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 the browser of your choice with this command:

npm run serve-gh-pages

and navigating to these two URLs:

http://localhost:8080/test/unit.html
http://localhost:8080/test/integration.html

Code of Conduct

This project adheres to the Open Code of Conduct. By participating, you are expected to honor this code.

License

MIT License

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].