# postcss-at-debug

> Keep nodes inside the @debug at-rule in debug mode and remove them in release mode

Latest version **1.0.0** (published 2024-06-20) · MIT license · 0 weekly downloads

## Install

```sh
npm install postcss-at-debug
pnpm add postcss-at-debug
yarn add postcss-at-debug
bun add postcss-at-debug
```

## 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.0 |
| Published | 2024-06-20 |
| First published | 2017-01-29 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >=18.0.0 |
| Dependencies | 0 |
| Unpacked size | 6.2 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Nick Odnari |
| Maintainers | odnari |
| Keywords | postcss, css, postcss-plugin |

## Links

- npm: https://www.npmjs.com/package/postcss-at-debug
- Repository: https://github.com/odnari/postcss-at-debug
- Homepage: https://github.com/odnari/postcss-at-debug#readme
- Issues: https://github.com/odnari/postcss-at-debug/issues
- npm.io page: https://npm.io/package/postcss-at-debug

## 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.0 (latest) — 2024-06-20
- 0.1.5 — 2024-06-20
- 0.1.4 — 2024-06-20
- 0.1.3 — 2021-10-28
- 0.1.2 — 2017-01-30
- 0.1.1 — 2017-01-29
- 0.1.0 — 2017-01-29

## README

# PostCSS At-Debug

[![Testing](https://github.com/odnari/postcss-at-debug/actions/workflows/testing.yml/badge.svg?branch=master)](https://github.com/odnari/postcss-at-debug/actions/workflows/testing.yml) ![npm](https://img.shields.io/npm/v/postcss-at-debug?style=plastic)

[PostCSS](https://github.com/postcss/postcss) plugin to keep nodes inside the @debug at-rule in debug mode and remove them in release mode.

### Install

`npm install postcss-at-debug --save-dev`

# Usage

## Debug mode
```js
var postcss = require('postcss');
var debug = require('postcss-at-debug');

var fs = require('fs');

var mycss = fs.readFileSync('input.css', 'utf8');

var output = postcss([
		debug({
		    debug: true
		})
	])
	.process(mycss)
	.css;

console.log(output);
```

Input:
```css
@debug {
    .body {
        color: red;
    }

    #root {
        background-color: blue;
    }
}

h1 {
    font-style: italic;
}
```

Output:
```css
#root {
    background-color: blue;
}

.body {
    color: red;
}

h1 {
    font-style: italic;
}
```


## Release mode
```js
// ...

var output = postcss([
		debug({
		    debug: false
		})
	])
	.process(mycss)
	.css;

console.log(output);
```

Input:
```css
@debug {
    .body {
        color: red;
    }

    #root {
        background-color: blue;
    }
}

h1 {
    font-style: italic;
}
```

Output:
```css
h1 {
    font-style: italic;
}
```

# Options

 - `debug`: boolean - flag for debug mode
	  - Default: `'true'`


# Testing

`npm test`

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