
Security News
npm Adopts OIDC for Trusted Publishing in CI/CD Workflows
npm now supports Trusted Publishing with OIDC, enabling secure package publishing directly from CI/CD workflows without relying on long-lived tokens.
jss-plugin-sort-css-media-queries
Advanced tools
JSS plugin for sort CSS media queries
npm i jss-plugin-sort-css-media-queries
desktopFirst
type: boolean
default: false
By default, plugin is using mobileFirst methodology for sorting CSS Media Queries.
By this option you can change behavior to the desktopFirst methodology.
combineMediaQueries
type: boolean
default: false
You can combine similar CSS Media Queries rules into the one block.
import jss from 'jss';
jss.use(sortCssMediaQueries());
const sheet = jss.createStyleSheet({
button: {
width: 100,
'@media (min-width: 600px)': {
width: 150
}
},
span: {
color: 'blue',
'@media (min-width: 600px)': {
width: 'yellow'
}
}
});
Result without combineMediaQueries
button {
width: 100px;
}
span {
color: blue;
}
@media (min-width: 600px) {
button {
width: 150px;
}
}
@media (min-width: 600px) {
span {
color: yellow;
}
}
Result with combineMediaQueries: true
button {
width: 100px;
}
span {
color: blue;
}
@media (min-width: 600px) {
button {
width: 150px;
}
span {
color: yellow;
}
}
Unfortunately, I have not found a more correct method of influencing the sorting of the list of rules than how to modify the
RuleList::toString()
method.
That is a wrong way from the architecture OOP principles, but it is the most non-breaking way for the whole JSS workflow.
After calling.toString()
method JSS work is done and in this point I can make own job with sorting, combining and returning CSS output.
Please fill free to create issues or send PR
FAQs
JSS plugin for sort CSS media queries
The npm package jss-plugin-sort-css-media-queries receives a total of 2,047 weekly downloads. As such, jss-plugin-sort-css-media-queries popularity was classified as popular.
We found that jss-plugin-sort-css-media-queries 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
npm now supports Trusted Publishing with OIDC, enabling secure package publishing directly from CI/CD workflows without relying on long-lived tokens.
Research
/Security News
A RubyGems malware campaign used 60 malicious packages posing as automation tools to steal credentials from social media and marketing tool users.
Security News
The CNA Scorecard ranks CVE issuers by data completeness, revealing major gaps in patch info and software identifiers across thousands of vulnerabilities.