Skip to content

Media query events listener

Notifications You must be signed in to change notification settings

Tolkam-JS-Packages/lib-match-media

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

tolkam/lib-match-media

Media query events listener.

Usage

import MM from '@tolkam/lib-match-media';

const rules = {
    small: '(max-width:575px)',
    med: '(min-width:576px) and (max-width:767px)',
    landscape: 'all and (orientation: landscape)',
};

const mm = new MM(rules);

mm.listen((matches) => {
    console.log('matches %O', matches);
});

Documentation

The code is rather self-explanatory and API is intended to be as simple as possible. Please, read the sources/Docblock if you have any questions. See Usage for quick start.

License

Proprietary / Unlicensed 🤷

About

Media query events listener

Resources

Stars

Watchers

Forks

Packages

No packages published