Modernizr

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

MIT License

Downloads
346.7K
Stars
25.6K
Committers
321
HTML5 CSS3
  •   [here](/README.id.md)
    
  •   [here](/README.sp.md)
    
  •   [here](/README.sv.md)
    
  •   [here](/README.ta.md)
    
  •   [here](/README.ka.md)
    
  •    [here](/README.hi.md)
    
  •   ,      (https://modernizr.com)       
    
  •      CSS3  HTML5            :  ``      ,  `<html>`                        
    

V4

  • <= 10 , 12

  •   :
    
      •  `class`  `es6 class`
        
  •   :
    
    • cookies, indexeddb, indexedblob, quota-management-api, userdata storage subdirectory
    • audio
    • battery moved into the battery subdirectory
    • canvas, canvastext
    • customevent, eventlistener, forcetouch, hashchange, pointerevents, proximity Event subdirectory
    • exiforientation
    • capture, fileinput, fileinputdirectory, formatattribute, input, inputnumber-l10n, inputsearchevent, inputtypes, placeholder, requestautocomplete, validation
    • svg svg
    • webgl webgl
  • :
    
    • touchevents: discussion
    • unicode: discussion
    • templatestrings: es6 stringtemplate
    • contains: es6 es6string
    • datalistelem: Modernizr.input.list

Asynchronous Event Listeners

, <html> ****

API :

// 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!");
  }
});
        (    ``   )         

`` , , src/addTest , `on`

  • npm install

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
});
    -  JSON         [`lib/config-all.json`](lib/config-all.json) 

-

modernizr :

./bin/modernizr

'config-all.json' npm :

npm start
//outputs to ./dist/modernizr-build.js

-- :

npm test
         :
npm run serve-gh-pages
  :
http://localhost:8080/test/unit.html
http://localhost:8080/test/integration.html

MIT License