Security News
cURL Project and Go Security Teams Reject CVSS as Broken
cURL and Go security teams are publicly rejecting CVSS as flawed for assessing vulnerabilities and are calling for more accurate, context-aware approaches.
media-match
Advanced tools
Test css media queries in javascript. A faster polyfill for matchMedia support.
Test css media queries in javascript. A faster polyfill for matchMedia support. Follow the project on Twitter @mediamatchjs.
all
, screen
, print
, speech
, projection
, handheld
, tv
, braille
, embossed
, tty
width
, min-width
, max-width
height
, min-height
, max-height
device-width
, min-device-width
, max-device-width
device-height
, min-device-height
, max-device-height
aspect-ratio
, min-aspect-ratio
, max-aspect-ratio
device-aspect-ratio
, min-device-aspect-ratio
, max-device-aspect-ratio
orientation
resolution
, min-resolution
, max-resolution
device-pixel-ratio
, min-device-pixel-ratio
, max-device-pixel-ratio
color
, min-color
, max-color
color-index
, min-color-index
, max-color-index
###Lacks support
monochrome
, min-monochrome
, max-monochrome
scan
grid
####media.match.min.js/media.match.js
Both code blocks are valid uses of matchMedia()
. The first example shows the caching of a MediaQueryList
object and the second shows an alternative usage as well as addListener
support.
The addListener
method is part of the MediaQueryList
object, therefore it can be added on the cached version or immediately after matchMedia()
.
<script type="text/javascript">
var mql = window.matchMedia('screen and (color) and (orientation: landscape) and (min-width: 600px) and (min-height: 400px)');
//console.log(mql);
/*
mql has the following properties:
matches : <Boolean>
media : <String>
addListener : <Function>
removeListener : <Function>
*/
</script>
<script type="text/javascript">
window.matchMedia('screen and (min-width: 600px) and (min-height: 400px), screen and (min-height: 400px)')
.addListener(function(mql) {
if (mql.matches) {
// Media query does match
} else {
// Media query does not match anymore
}
});
</script>
##Related projects
FAQs
Test css media queries in javascript. A faster polyfill for matchMedia support.
The npm package media-match receives a total of 442 weekly downloads. As such, media-match popularity was classified as not popular.
We found that media-match demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
cURL and Go security teams are publicly rejecting CVSS as flawed for assessing vulnerabilities and are calling for more accurate, context-aware approaches.
Security News
Bun 1.2 enhances its JavaScript runtime with 90% Node.js compatibility, built-in S3 and Postgres support, HTML Imports, and faster, cloud-first performance.
Security News
Biden's executive order pushes for AI-driven cybersecurity, software supply chain transparency, and stronger protections for federal and open source systems.