# postcss-optional-comments

> A PostCSS plugin for conditional comments

Latest version **1.0.2** (published 2016-01-18) · MIT license · 0 weekly downloads

## Install

```sh
npm install postcss-optional-comments
pnpm add postcss-optional-comments
yarn add postcss-optional-comments
bun add postcss-optional-comments
```

## 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 |
| Published | 2016-01-18 |
| First published | 2016-01-10 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Known vulnerabilities | 0 (+6 in 1 direct dependencies) |
| Install scripts | no |
| GitHub stars | 2 |
| Author | Timothy |
| Maintainers | codetheory |
| Keywords | postcss, css, comments, single, line, comments, multiline, comments, optional, comments, conditional, comments |

## Links

- npm: https://www.npmjs.com/package/postcss-optional-comments
- Repository: https://github.com/CodeTheory/postcss-optional-comments
- Homepage: https://github.com/CodeTheory/postcss-optional-comments#readme
- Issues: https://github.com/CodeTheory/postcss-optional-comments/issues
- npm.io page: https://npm.io/package/postcss-optional-comments

## Dependencies (1)

- [postcss](https://npm.io/package/postcss.md) ^5.0.14

## 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 (latest) — 2016-01-18
- 1.0.1 — 2016-01-10
- 1.0.0 — 2016-01-10

## README

# postcss-optional-comments <a href="https://circleci.com/gh/CodeTheory/postcss-optional-comments" rel="postcss-optional-comments CircleCI Project">![postcss-optional-comments CircleCI Project](https://img.shields.io/circleci/project/CodeTheory/postcss-optional-comments.svg)</a> <a href="https://www.npmjs.com/package/postcss-optional-comments" rel="postcss-optional-comments on NPM">![postcss-optional-comments on NPM](https://img.shields.io/npm/v/postcss-optional-comments.svg)</a>

Support for conditional comments using PostCSS.


## What does this do?
This plugin allows you to choose which comments will appear in your css output using a simple not operator, `/*!`, in the opening syntax of a CSS comment.


## Example

input.css:
```css
/*! This comment will be removed! */
/* This comment will be kept! */
a {}
```

output.css:
```css
/* This comment will be kept! */
a {}
```


## Installation
postcss-optional-comments is freely available to download from github or install via [NPM](https://www.npmjs.com/package/postcss-optional-comments).

Install using NPM:
```
npm i --save-dev postcss-optional-comments
```


## Usage

### Gulp
Use with `gulp-postcss` module.

```js
gulp.task('css', function () {
  var postcss          = require('gulp-postcss');
  var optionalComments = require('postcss-optional-comments');

  return gulp.src('./src/**/*.css')
    .pipe(postcss([ optionalComments ]))
    .pipe(gulp.dest('./dest'));
});
```




## Todo
- Support single line comments


## Contributing
Feel free to submit a pull request!

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