mirror of
https://github.com/idanoo/GoScrobble
synced 2025-07-17 13:31:52 +00:00
0.2.0 - Mid migration
This commit is contained in:
parent
139e6a915e
commit
7e38fdbd7d
42393 changed files with 5358157 additions and 62 deletions
46
web/node_modules/postcss-normalize-charset/dist/index.js
generated
vendored
Normal file
46
web/node_modules/postcss-normalize-charset/dist/index.js
generated
vendored
Normal file
|
@ -0,0 +1,46 @@
|
|||
'use strict';
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
|
||||
var _postcss = require('postcss');
|
||||
|
||||
var _postcss2 = _interopRequireDefault(_postcss);
|
||||
|
||||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||||
|
||||
let charset = 'charset';
|
||||
|
||||
exports.default = _postcss2.default.plugin('postcss-normalize-' + charset, (opts = {}) => {
|
||||
return css => {
|
||||
let charsetRule;
|
||||
let nonAsciiNode;
|
||||
let nonAscii = /[^\x00-\x7F]/;
|
||||
|
||||
css.walk(node => {
|
||||
if (node.type === 'atrule' && node.name === charset) {
|
||||
if (!charsetRule) {
|
||||
charsetRule = node;
|
||||
}
|
||||
node.remove();
|
||||
} else if (!nonAsciiNode && node.parent === css && nonAscii.test(node)) {
|
||||
nonAsciiNode = node;
|
||||
}
|
||||
});
|
||||
|
||||
if (nonAsciiNode) {
|
||||
if (!charsetRule && opts.add !== false) {
|
||||
charsetRule = _postcss2.default.atRule({
|
||||
name: charset,
|
||||
params: '"utf-8"'
|
||||
});
|
||||
}
|
||||
if (charsetRule) {
|
||||
charsetRule.source = nonAsciiNode.source;
|
||||
css.prepend(charsetRule);
|
||||
}
|
||||
}
|
||||
};
|
||||
});
|
||||
module.exports = exports['default'];
|
Loading…
Add table
Add a link
Reference in a new issue