Current collected state Current
Observed since 20 Oct, 22:15 UTC
No superseded metadata states collected. Unchanged observations do not create new revisions.
@0saw/foundation-media-query
Lightweight addon to suit your crazy frontend needs
Small little nifty utility to help you work with foundation-sites media queries.
No dependencies. Except for foundation (Da-a-ah). Adds CustomEvent polyfill.
import mq from "@0saw/foundation-media-query";
document.addEventListener('breakpoint-change', breakpointEventListener);
function breakpointEventListener() {
if (mq.is('large only')) {
console.log("You've hit the right spot");
}
}
You are not obligated to import mq to your scope. Instead you can use event.detail like so:
import "@0saw/foundation-media-query";
document.addEventListener('breakpoint-change', breakpointEventListener);
function breakpointEventListener(event) {
let mq = event.detail;
switch (mq.current) {
case 'medium':
alert("You've hit the right spot");
break;
case 'large':
alert("Too far");
break;
default:
break;
}
}
mq object contains a few useful things.
current - Gives you the name of current breakpointcurrentFull - Gives you all of the breakpoint info that we have. (I.e mq.currentFull.matchMedia will give you matchMedia object. In case you want to do something naughty)landscape - Analog of CSS's (orientation: landscape)portrait - Pretty straight forwardretina - DPI is at least 2xis - Allows you to quickly check current breakpoint// Either true or false
mq.is('xlarge');
// Won't return true when next breakpoint is active. ([small -> medium] -> large)
mq.is('medium only');
// portrait/ladscape/retina
mq.is('portrait');
@include foundation-global-styles;Download counts and popularity will appear here as the collector receives them.
Declarations describe requirements; they are not a resolved dependency graph.
Source distribution
{
"integrity": "sha512-5+GOpjQ+pDYZzgMffnEhqDUjVb6rDZd1CbFl98SrNzeexduvRSQtBDnrLsuvafMyhAW6JE+FPvz7XFHVv1u+YQ==",
"shasum": "a1f1a7a484fa7a218a004541989b7642fdfb234d",
"tarball": "https://registry.npmjs.org/@0saw/foundation-media-query/-/foundation-media-query-1.0.5.tgz",
"fileCount": 24,
"unpackedSize": 78338,
"npm-signature": "-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJc0VjZCRA9TVsSAnZWagAAgtIP/RQx1Yc8UmTh/+GCHgs0\nV/6KxjhMHJ51mw7ZDVjKeQNvmtmFTQkKDzokGy0+gjHTKgXnsbaXXT1wPQkZ\nq4QYrgQk18k/QsAnnbYD4QbKvRFqkkLqk/N7KO4WDoVMHbxnR/4nMrix/Ljs\nmUxwTAiLE+wkLiGRMoEfkQQ2oS8DAD/MN1Oo2iEl+gsVz/7osoNaOKSYAS7Y\nW5hBxKNXg+AWbiWJtBUmXIjacWuIMETS3I7jNSkuZbwSNSiPxzN2aAtsz8xi\n5584+jV7be49DWbdWH48EKj2eX2YnTn8mHMRtdd81jw1TTkj930yyEzJYBXi\nMKjNmK2WYF5jRMJWajN7LLnS0XI1sSZLG8tHfOIcYZ6pTJzEeyjVoyEO6yb/\n0n8KdXEDEZ28eM5yjF9XRGUWqeMXUAXxnmaxoxxwnVv8mp9irtVdVGy2A67U\nn9/mVDJxowHoe+BQxIq3T5tkzLhS183B2040M1ixT9OUj90DRbHonOCgIinU\nISA9yB5Cy7Ij9655107BNkkdpnm9nzP38QMmYKUr1gKX0bW2N31i5/pY+pkZ\nIS837TkFG9gaHDluG1zjg55gZuBb5EPD/6Mo/j2iDHT1g+VpPJvUpm18yo1f\nvZ86YcFXSYl8faM8SQsK8w0o18gzIiRCVLrhwigSTJwND0TlgLMTpGaQGR8o\n2p+P\r\n=zCIs\r\n-----END PGP SIGNATURE-----\r\n",
"signatures": [
{
"keyid": "SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA",
"sig": "MEUCIQC5XP1UCGqAEoVWvNbo8Mt2DcFbdBVKI3kAInWT0gYVIQIgANiVYWWBJLGuGNd+EjRsbpZydXrJ/SWE6aWsCEz+85E="
}
]
}Shared repository data · GitHub
Observed since 20 Oct, 22:15 UTC
No superseded metadata states collected. Unchanged observations do not create new revisions.
package_version:44beb72e16de361008a9bc470cbccbbd92e693cb6a7fb2667e775901e45f5403