Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

gulp-replace-important

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

gulp-replace-important

Gulp Wrapper for the replace-important module

  • 1.0.2-alpha
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
5
increased by66.67%
Maintainers
1
Weekly downloads
 
Created
Source

gulp-replace-important

Gulp plugin for replace-important. Plugin for removing !important from css rules from selectors and replacing them inside similar selectors - the new selectors will have the highest specificity in the CSS file. This is useful for making CSS Supported by AMPHTML. This plugin only supports Buffers, but stream support could be added with gulp-streamify.

Installation

As a dev dependency to your project

npm install --save-dev gulp-replace-important

Usage

const gulp = require('gulp');
const gulpReplaceImportant = require('gulp-replace-important');

/**
* Example:
* Input: body {background-color: red !important;}
*
* Output: body {}:root:not(#FK_ID) body{background-color: red }
*/
gulp.task('css:important', () => {
  return gulp.src('*.css')
    // Validate the input and attach the validation result to the "amp" property
    // of the file object.  
    .pipe(gulpReplaceImportant())
    .pipe(gulp.dest('gulp-replace-important-test'))
});

Tests

Tests can be run with:

npm run test

Contributing

Please see the CONTRIBUTING.md

License

Apache License 2.0

Keywords

FAQs

Package last updated on 14 Aug 2017

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