media-query-solver
Solve media queries (and detect useless ones!)
Try with
npx
:
This package is available from the npm
registry.
npm install media-query-solver
Supports JavaScript + TypeScript:
import { solveMediaQueryList } from "media-query-solver";
solveMediaQueryList(`not all`);
// => "false"
solveMediaQueryList(`all`);
// => "true"
solveMediaQueryList(`(width > 100px)`);
// => "unknown"
solveMediaQueryList(`(width > 100px)`, {
// this function can be modified to provide custom functionality
solveUnknownFeature: (featureNode) => "true",
});
// => "true"
Can also be imported via require("media-query-solver")
.
Dev environment (for contributing) requires:
MIT
Generated using TypeDoc