Open-Awesome
CategoriesAlternativesStacksSelf-HostedExplore
Open-Awesome

© 2026 Open-Awesome. Curated for the developer elite.

TermsPrivacyAboutGitHubRSS
  1. Home
  2. Gulp
  3. gulp-uncss

gulp-uncss

MITJavaScript

A deprecated Gulp plugin that removes unused CSS selectors from stylesheets by analyzing HTML files.

GitHubGitHub
931 stars38 forks0 contributors

What is gulp-uncss?

gulp-uncss is a deprecated Gulp plugin that removes unused CSS selectors from stylesheets. It analyzes HTML files, URLs, or inline HTML to identify which CSS rules are actually used, then strips out the rest to reduce file size and improve front-end performance. The plugin integrates into Gulp build pipelines, allowing chaining with other CSS processing steps like Sass compilation and minification.

Target Audience

Frontend developers and build engineers using Gulp for their build processes who need to optimize CSS file sizes by removing unused styles.

Value Proposition

It automates the removal of unused CSS directly within Gulp workflows, offering a streamlined way to reduce stylesheet bloat without manual auditing. However, it's now deprecated in favor of using UnCSS as a PostCSS plugin for more flexible CSS processing.

Overview

DEPRECATED. Remove unused CSS selectors.

Use Cases

Best For

  • Optimizing CSS file sizes in Gulp-based build pipelines
  • Removing unused styles from legacy or large CSS codebases
  • Integrating CSS cleanup with Sass or other preprocessors in Gulp tasks
  • Automating performance improvements for static websites
  • Reducing CSS bloat in projects with multiple HTML templates
  • Chaining CSS minification with unused selector removal in builds

Not Ideal For

  • New projects adopting PostCSS or modern bundlers like Vite or Webpack
  • Teams requiring active plugin maintenance and community support
  • Build pipelines that integrate multiple PostCSS plugins for CSS processing
  • Projects where avoiding deprecated dependencies is a priority

Pros & Cons

Pros

Gulp Pipeline Integration

Seamlessly fits into Gulp streams, enabling easy chaining with tasks like Sass compilation and minification, as demonstrated in the README example with gulp-sass and gulp-cssnano.

Flexible HTML Source Support

Accepts local files, glob patterns, URLs, and raw HTML strings for CSS analysis, allowing comprehensive detection of used styles across various inputs.

Dynamic Selector Ignoring

Supports preserving selectors for interactive states (e.g., hover or click) via literal names or regex patterns, preventing accidental removal of user interaction styles.

Cons

Officially Deprecated

The README includes a deprecation notice, recommending migration to postcss-uncss, meaning no updates, bug fixes, or new features will be added.

Redundant in Modern Stacks

UnCSS is now a PostCSS plugin, making gulp-uncss an unnecessary middleman; PostCSS integration allows more flexible and efficient CSS processing with plugins like cssnano.

Gulp-Only Limitation

Ties CSS optimization to Gulp, which can be restrictive for teams using other build tools or seeking framework-agnostic solutions.

Frequently Asked Questions

Quick Stats

Stars931
Forks38
Contributors0
Open Issues3
Last commit9 years ago
CreatedSince 2013

Tags

#deprecated#css-optimization#frontend#postcss#build-tool#performance#gulp-plugin

Built With

G
Gulp
N
Node.js

Included in

Web Performance Optimization8.9kGulp624
Auto-fetched 2 hours ago

Related Projects

UglifyUglify

JavaScript parser / mangler / compressor / beautifier toolkit

Stars13,389
Forks1,223
Last commit1 year ago
clean-cssclean-css

Fast and efficient CSS optimizer for node.js and the Web

Stars4,203
Forks318
Last commit1 year ago
Grunt-uncssGrunt-uncss

:scissors: A grunt task for removing unused CSS from your projects.

Stars3,795
Forks170
Last commit2 years ago
CSSOCSSO

CSS minifier with structural optimizations

Stars3,791
Forks187
Last commit2 years ago
Community-curated · Updated weekly · 100% open source

Found a gem we're missing?

Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.

Submit a projectStar on GitHub