# gulp-replace-important

> Gulp Wrapper for the replace-important module

Latest version **1.0.2-alpha** (published 2017-08-14) · Apache-2.0 license · 0 weekly downloads

## Install

```sh
npm install gulp-replace-important
pnpm add gulp-replace-important
yarn add gulp-replace-important
bun add gulp-replace-important
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.2-alpha |
| Published | 2017-08-14 |
| First published | 2017-08-05 |
| Weekly downloads | 0 |
| License | Apache-2.0 |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 3 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 415 |
| Author | The AMP HTML Authors |
| Maintainers | amphtml-tools |
| Keywords | replace, !important, CSS, AMP |

## Links

- npm: https://www.npmjs.com/package/gulp-replace-important
- Repository: https://github.com/ampproject/ampstart/tree/master/tools/gulp-replace-important
- Homepage: https://github.com/ampproject/ampstart#readme
- Issues: https://github.com/ampproject/ampstart/issues
- npm.io page: https://npm.io/package/gulp-replace-important

## Dependencies (3)

- [through2](https://npm.io/package/through2.md) ^2.0.3
- [gulp-util](https://npm.io/package/gulp-util.md) ^3.0.8
- [replace-important](https://npm.io/package/replace-important.md) 1.0.0-alpha

## Alternatives

- [style-dictionary](https://npm.io/package/style-dictionary.md) — 2.0M weekly downloads
- [postcss-merge-idents](https://npm.io/package/postcss-merge-idents.md) — 1.7M weekly downloads
- [@fontsource/noto-sans](https://npm.io/package/@fontsource/noto-sans.md) — 93.0K weekly downloads
- [uglifycss](https://npm.io/package/uglifycss.md) — 71.6K weekly downloads
- [mat4-interpolate](https://npm.io/package/mat4-interpolate.md) — 23.3K weekly downloads

## Recent versions

- 1.0.2-alpha (latest) — 2017-08-14
- 1.0.1-alpha — 2017-08-11
- 1.0.0-alpha — 2017-08-05

## README

# gulp-replace-important

Gulp plugin for [replace-important](../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](https://www.ampproject.org/docs/guides/responsive/style_pages). This plugin only supports Buffers, but stream support could be added with [gulp-streamify](https://github.com/nfroidure/gulp-streamify).

# Installation

**As a dev dependency to your project**
```
npm install --save-dev gulp-replace-important
```

# Usage

```javascript
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](../../CONTRIBUTING.md)

# License
[Apache License 2.0](https://choosealicense.com/licenses/apache-2.0/)

---
_Source: https://npm.io/package/gulp-replace-important · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
