Socket
Socket
Sign inDemoInstall

gulp-postcss

Package Overview
Dependencies
Maintainers
1
Versions
39
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

gulp-postcss

PostCSS gulp plugin


Version published
Weekly downloads
158K
decreased by-19.54%
Maintainers
1
Weekly downloads
 
Created

What is gulp-postcss?

gulp-postcss is a Gulp plugin to pipe CSS through several PostCSS plugins, allowing you to transform styles with JS plugins. It is highly flexible and can be used for a variety of CSS processing tasks such as autoprefixing, minification, and linting.

What are gulp-postcss's main functionalities?

Autoprefixing

This feature allows you to automatically add vendor prefixes to your CSS rules using the autoprefixer PostCSS plugin. This ensures compatibility with different browsers.

const gulp = require('gulp');
const postcss = require('gulp-postcss');
const autoprefixer = require('autoprefixer');

gulp.task('css', function () {
  return gulp.src('src/*.css')
    .pipe(postcss([autoprefixer()]))
    .pipe(gulp.dest('dest'));
});

CSS Minification

This feature allows you to minify your CSS files using the cssnano PostCSS plugin, which helps in reducing the file size and improving load times.

const gulp = require('gulp');
const postcss = require('gulp-postcss');
const cssnano = require('cssnano');

gulp.task('minify-css', function () {
  return gulp.src('src/*.css')
    .pipe(postcss([cssnano()]))
    .pipe(gulp.dest('dest'));
});

Linting CSS

This feature allows you to lint your CSS files using the stylelint PostCSS plugin, which helps in maintaining code quality and consistency.

const gulp = require('gulp');
const postcss = require('gulp-postcss');
const stylelint = require('stylelint');
const reporter = require('postcss-reporter');

gulp.task('lint-css', function () {
  return gulp.src('src/*.css')
    .pipe(postcss([
      stylelint(),
      reporter({ clearReportedMessages: true })
    ]));
});

Other packages similar to gulp-postcss

Keywords

FAQs

Package last updated on 06 Feb 2024

Did you know?

Socket

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc