# postcss-single-charset

> A PostCSS plugin for popping first @charset rule up in CSS file

Latest version **2.0.0** (published 2017-05-07) · MIT license · 0 weekly downloads

> **Deprecated.** This package is deprecated.

## Install

```sh
npm install postcss-single-charset
pnpm add postcss-single-charset
yarn add postcss-single-charset
bun add postcss-single-charset
```

## Health

**Score 10/100 (F)** — status: deprecated.

Negative: deprecated.

## Facts

| | |
|---|---|
| Version | 2.0.0 |
| Published | 2017-05-07 |
| First published | 2015-01-09 |
| 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 | 8 |
| Author | Kyo Nagashima |
| Maintainers | hail2u |
| Keywords | css, charset, postcss-plugin |

## Links

- npm: https://www.npmjs.com/package/postcss-single-charset
- Repository: https://github.com/hail2u/postcss-single-charset
- Issues: https://github.com/hail2u/postcss-single-charset/issues
- npm.io page: https://npm.io/package/postcss-single-charset

## Dependencies (1)

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

## 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

- 2.0.0 (latest) — 2017-05-07
- 1.0.1 — 2017-05-07
- 1.0.0 — 2015-08-23
- 0.3.0 — 2015-05-23
- 0.2.2 — 2015-01-10
- 0.2.1 — 2015-01-09
- 0.2.0 — 2015-01-09
- 0.1.0 — 2015-01-09

## README

postcss-single-charset
======================

A [PostCSS][1] plugin for popping first @charset rule up in CSS file


SYNOPSIS
--------

Sometimes concatenated CSS file has `@charset` directive in the middle or has
many `@charset` directives:

    .foo {
      color: red;
    }
    
    @charset "Shift_JIS";
    
    .bar {
      color: green;
    }
    
    @charset "Shift_JIS";
    
    .baz {
      color: blue;
    }

This PostCSS plugin fixes these invalid `@charset` like this:

    @charset "Shift_JIS";
    
    .foo {
      color: red;
    }
    
    .bar {
      color: green;
    }
    
    .baz {
      color: blue;
    }


INSTALL
-------

    $ npm install postcss-single-charset


USAGE
-----

    var fs = require("fs");
    var postcss = require("postcss");
    
    var css = fs.readFileSync("input.css", "utf8");
    postcss([
      require("postcss-single-charset")()
    ]).process(css).then(function (result) {
      fs.writeFileSync("output.css", result.css);
    });


LICENSE
-------

MIT: http://hail2u.mit-license.org/2015


[1]: https://github.com/postcss/postcss

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