
Security News
Oracle Drags Its Feet in the JavaScript Trademark Dispute
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
media-engine
Advanced tools
Media queries engine written in pure JS!
npm install media-engine --save
# or
yarn add media-engine
min-height
matchMedia(
{
'@media min-height: 700': {
color: 'green',
},
},
{ height: 800 }
);
// { color: 'green' }
matchMedia(
{
'@media min-height: 700': {
color: 'green',
},
},
{ height: 100 }
);
// { }
max-height
matchMedia(
{
'@media max-height: 700': {
color: 'green',
},
},
{ height: 100 }
);
// { color: 'green' }
matchMedia(
{
'@media max-height: 700': {
color: 'green',
},
},
{ height: 800 }
);
// { }
min-width
matchMedia(
{
'@media min-width: 700': {
color: 'green',
},
},
{ width: 800 }
);
// { color: 'green' }
matchMedia(
{
'@media min-width: 700': {
color: 'green',
},
},
{ width: 100 }
);
// { }
max-width
matchMedia(
{
'@media max-width: 700': {
color: 'green',
},
},
{ width: 100 }
);
// { color: 'green' }
matchMedia(
{
'@media max-width: 700': {
color: 'green',
},
},
{ width: 800 }
);
// { }
orientation
matchMedia(
{
'@media orientation: landscape': {
color: 'green',
},
},
{ orientation: 'landscape' }
);
// { color: 'green' }
matchMedia(
{
'@media orientation: landscape': {
color: 'green',
},
},
{ orientation: 'portrait' }
);
// { }
and operator
matchMedia(
{
'@media (min-width: 700) and (orientation: landscape)': {
color: 'green',
},
},
{ width: 800, orientation: 'landscape' }
);
// { color: 'green' }
or operator
matchMedia(
{
'@media (min-width: 700), (orientation: landscape)': {
color: 'green',
},
},
{ orientation: 'landscape' }
);
// { color: 'green' }
multiple queries
matchMedia(
{
'@media orientation: landscape': {
color: 'green',
},
'@media min-width: 700': {
background: 'red',
}
},
{ orientation: 'landscape', width: 800 }
);
// { color: 'green', background: 'red' }
MIT © Diego Muracciole
FAQs
Media query calculator
The npm package media-engine receives a total of 648,145 weekly downloads. As such, media-engine popularity was classified as popular.
We found that media-engine 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
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.
Security News
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.