postcss-single-charset

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

Package no longer supported. Contact support@npmjs.com for more info.
Last updated 9 years ago by hail2u .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install postcss-single-charset 
SYNC missed versions from official npm registry.

postcss-single-charset

A PostCSS 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

Current Tags

  • 2.0.0                                ...           latest (9 years ago)

8 Versions

  • 2.0.0 [deprecated]           ...           9 years ago
  • 1.0.1 [deprecated]           ...           9 years ago
  • 1.0.0 [deprecated]           ...           11 years ago
  • 0.3.0 [deprecated]           ...           11 years ago
  • 0.2.2 [deprecated]           ...           11 years ago
  • 0.2.1 [deprecated]           ...           11 years ago
  • 0.2.0 [deprecated]           ...           11 years ago
  • 0.1.0 [deprecated]           ...           11 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 7
Last Day 0
Last Week 7
Last Month 1
Dependencies (1)
Dev Dependencies (0)
None
Dependents (1)

Copyright 2013 - present © cnpmjs.org | Home |