mirror of
https://github.com/wu736139669/Monkey-Test.git
synced 2026-08-05 05:55:46 +00:00
18 lines
370 B
JavaScript
18 lines
370 B
JavaScript
"use strict";
|
|
|
|
var postcss = require("postcss");
|
|
|
|
module.exports = postcss.plugin("single-charset", function () {
|
|
return function (css) {
|
|
var metCharset = false;
|
|
css.eachAtRule("charset", function (atRule) {
|
|
if (!metCharset) {
|
|
metCharset = true;
|
|
atRule.parent.prepend(atRule.clone());
|
|
}
|
|
|
|
atRule.removeSelf();
|
|
});
|
|
};
|
|
});
|