
Security News
ESLint Adds Official Support for Linting HTML
ESLint now supports HTML linting with 48 new rules, expanding its language plugin system to cover more of the modern web development stack.
styled-media-helper
Advanced tools
This module makes easy to write media queries using styled-components.
Inspired by Bootstrap media-breakpoint-...
mixins.
$ npm install styled-media-helper
const styled = require('styled-components').default;
const mediaHelper = require('styled-media-helper');
const media = mediaHelper({
sm: 320,
md: 768,
lg: 1240
});
module.exports = styled.div`
width: 100px;
height: 100px;
background-color: blue;
${media.up('lg')} {
width: 150px;
}
// Output:
// @media (min-width: 1240px) {
// width: 150px;
// }
${media.down('sm')} {
background-color: black;
}
// Output:
// @media (max-width: 767.98px) {
// background-color: black;
// }
${media.between('sm', 'lg')} {
width: 200px;
}
// Output:
// @media (min-width: 320px) and (max-width: 1239.98px) {
// width: 200px;
// }
${media.only('md')} {
background-color: green;
}
// Output:
// @media (min-width: 768px) and (max-width: 1239.98px) {
// background-color: green;
// }
${media.only('sm')} {
background-color: green;
}
// Output:
// @media (min-width: 320px) and (max-width: 767.98px) {
// background-color: green;
// }
${media.only('lg')} {
border-radius: 15px;
}
// Output:
// @media (min-width: 1240px) {
// border-radius: 15px;
// }
`;
FAQs
helper for media query
The npm package styled-media-helper receives a total of 534 weekly downloads. As such, styled-media-helper popularity was classified as not popular.
We found that styled-media-helper 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
ESLint now supports HTML linting with 48 new rules, expanding its language plugin system to cover more of the modern web development stack.
Security News
CISA is discontinuing official RSS support for KEV and cybersecurity alerts, shifting updates to email and social media, disrupting automation workflows.
Security News
The MCP community is launching an official registry to standardize AI tool discovery and let agents dynamically find and install MCP servers.