
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
postcss-print
Advanced tools
PostCSS plugin to extract all @media print from your stylesheets and move it to a print.css file
This is really specific for my needs right now and it may evolve for a better opensource plugin, but right now I don't really recommend it's use, as it's not even tested.
npm install postcss-print
generate (default: false)This is the option that generates the new print.css file, I use it like this (with Grunt):
generatePrint: {
options: {
processors: [
require('postcss-print')({ generate: true })
]
},
src : 'public/css/dist/all.min.css',
dest : 'public/css/dist/print.css'
}
pure (default: false)This option removes all occurences of @media print from your original css files. I use it like this (with Grunt):
removePrint: {
options: {
processors: [
require('postcss-print')({ remove: true })
]
},
src: 'public/css/dist/*.min.css'
}
Plugin can be used just like any other PostCSS plugin. For example, Gulp setup (using gulp-postcss).
Or Grunt setup (using grunt-postcss):
module.exports = function(grunt) {
grunt.config('postcss', {
prefix: {
options: {
map : true,
diff : true,
processors: [
require('autoprefixer-core')({ browsers: ['> 1%', 'last 1 version', 'ie 8', 'ie 9'] })
]
},
src: 'public/css/dist/*.css'
},
generatePrint: {
options: {
processors: [
require('postcss-print')({ generate: true })
]
},
src : 'public/css/dist/all.min.css',
dest : 'public/css/dist/print.css'
},
removePrint: {
options: {
processors: [
require('postcss-print')({ remove: true })
]
},
src: 'public/css/dist/*.min.css'
}
});
grunt.loadNpmTasks('grunt-postcss');
};
And then use the print.css like this:
<link rel="stylesheet" href="print.css" media="print">
MIT © Gustavo Siqueira
FAQs
PostCSS plugin to extract all print css into a separated file.
We found that postcss-print 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
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.