first
This commit is contained in:
20
node_modules/postcss-normalize-charset/LICENSE
generated
vendored
Normal file
20
node_modules/postcss-normalize-charset/LICENSE
generated
vendored
Normal file
@ -0,0 +1,20 @@
|
||||
The MIT License (MIT)
|
||||
|
||||
Copyright 2015 Bogdan Chadkin <trysound@yandex.ru>
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy of
|
||||
this software and associated documentation files (the "Software"), to deal in
|
||||
the Software without restriction, including without limitation the rights to
|
||||
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
|
||||
the Software, and to permit persons to whom the Software is furnished to do so,
|
||||
subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
|
||||
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
|
||||
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
|
||||
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
||||
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
43
node_modules/postcss-normalize-charset/README.md
generated
vendored
Normal file
43
node_modules/postcss-normalize-charset/README.md
generated
vendored
Normal file
@ -0,0 +1,43 @@
|
||||
# postcss-normalize-charset
|
||||
|
||||
Add necessary or remove extra charset with PostCSS
|
||||
|
||||
```css
|
||||
a{
|
||||
content: "©";
|
||||
}
|
||||
```
|
||||
|
||||
```css
|
||||
@charset "utf-8";
|
||||
a{
|
||||
content: "©";
|
||||
}
|
||||
```
|
||||
|
||||
## API
|
||||
|
||||
### normalizeCharset([options])
|
||||
|
||||
#### options
|
||||
|
||||
##### add
|
||||
|
||||
Type: `boolean`
|
||||
Default: `true`
|
||||
|
||||
Pass `false` to stop the module from adding a `@charset` declaration if it was
|
||||
missing from the file (and the file contained non-ascii characters).
|
||||
|
||||
## Usage
|
||||
|
||||
See the [PostCSS documentation](https://github.com/postcss/postcss#usage) for
|
||||
examples for your environment.
|
||||
|
||||
## Contributors
|
||||
|
||||
See [CONTRIBUTORS.md](https://github.com/cssnano/cssnano/blob/master/CONTRIBUTORS.md).
|
||||
|
||||
## License
|
||||
|
||||
MIT © [Bogdan Chadkin](mailto:trysound@yandex.ru)
|
65
node_modules/postcss-normalize-charset/package.json
generated
vendored
Normal file
65
node_modules/postcss-normalize-charset/package.json
generated
vendored
Normal file
@ -0,0 +1,65 @@
|
||||
{
|
||||
"_from": "postcss-normalize-charset@^5.1.0",
|
||||
"_id": "postcss-normalize-charset@5.1.0",
|
||||
"_inBundle": false,
|
||||
"_integrity": "sha512-mSgUJ+pd/ldRGVx26p2wz9dNZ7ji6Pn8VWBajMXFf8jk7vUoSrZ2lt/wZR7DtlZYKesmZI680qjr2CeFF2fbUg==",
|
||||
"_location": "/postcss-normalize-charset",
|
||||
"_phantomChildren": {},
|
||||
"_requested": {
|
||||
"type": "range",
|
||||
"registry": true,
|
||||
"raw": "postcss-normalize-charset@^5.1.0",
|
||||
"name": "postcss-normalize-charset",
|
||||
"escapedName": "postcss-normalize-charset",
|
||||
"rawSpec": "^5.1.0",
|
||||
"saveSpec": null,
|
||||
"fetchSpec": "^5.1.0"
|
||||
},
|
||||
"_requiredBy": [
|
||||
"/cssnano-preset-default"
|
||||
],
|
||||
"_resolved": "https://registry.npmjs.org/postcss-normalize-charset/-/postcss-normalize-charset-5.1.0.tgz",
|
||||
"_shasum": "9302de0b29094b52c259e9b2cf8dc0879879f0ed",
|
||||
"_spec": "postcss-normalize-charset@^5.1.0",
|
||||
"_where": "C:\\Users\\zhouxueli\\Desktop\\scheduling-app\\node_modules\\cssnano-preset-default",
|
||||
"author": {
|
||||
"name": "Bogdan Chadkin",
|
||||
"email": "trysound@yandex.ru"
|
||||
},
|
||||
"bugs": {
|
||||
"url": "https://github.com/cssnano/cssnano/issues"
|
||||
},
|
||||
"bundleDependencies": false,
|
||||
"deprecated": false,
|
||||
"description": "Add necessary or remove extra charset with PostCSS",
|
||||
"devDependencies": {
|
||||
"postcss": "^8.2.15"
|
||||
},
|
||||
"engines": {
|
||||
"node": "^10 || ^12 || >=14.0"
|
||||
},
|
||||
"files": [
|
||||
"src",
|
||||
"LICENSE",
|
||||
"types"
|
||||
],
|
||||
"homepage": "https://github.com/cssnano/cssnano",
|
||||
"keywords": [
|
||||
"postcss",
|
||||
"css",
|
||||
"postcss-plugin",
|
||||
"charset"
|
||||
],
|
||||
"license": "MIT",
|
||||
"main": "src/index.js",
|
||||
"name": "postcss-normalize-charset",
|
||||
"peerDependencies": {
|
||||
"postcss": "^8.2.15"
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://github.com/cssnano/cssnano.git"
|
||||
},
|
||||
"types": "types/index.d.ts",
|
||||
"version": "5.1.0"
|
||||
}
|
56
node_modules/postcss-normalize-charset/src/index.js
generated
vendored
Normal file
56
node_modules/postcss-normalize-charset/src/index.js
generated
vendored
Normal file
@ -0,0 +1,56 @@
|
||||
'use strict';
|
||||
const charset = 'charset';
|
||||
// eslint-disable-next-line no-control-regex
|
||||
const nonAscii = /[^\x00-\x7F]/;
|
||||
|
||||
/**
|
||||
* @typedef {{add?: boolean}} Options
|
||||
*/
|
||||
/**
|
||||
* @type {import('postcss').PluginCreator<Options>}
|
||||
* @param {Options} opts
|
||||
* @return {import('postcss').Plugin}
|
||||
*/
|
||||
function pluginCreator(opts = {}) {
|
||||
return {
|
||||
postcssPlugin: 'postcss-normalize-' + charset,
|
||||
|
||||
OnceExit(css, { AtRule }) {
|
||||
/** @type {import('postcss').AtRule | undefined} */
|
||||
let charsetRule;
|
||||
/** @type {import('postcss').Node | undefined} */
|
||||
let nonAsciiNode;
|
||||
|
||||
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.toString())
|
||||
) {
|
||||
nonAsciiNode = node;
|
||||
}
|
||||
});
|
||||
|
||||
if (nonAsciiNode) {
|
||||
if (!charsetRule && opts.add !== false) {
|
||||
charsetRule = new AtRule({
|
||||
name: charset,
|
||||
params: '"utf-8"',
|
||||
});
|
||||
}
|
||||
if (charsetRule) {
|
||||
charsetRule.source = nonAsciiNode.source;
|
||||
css.prepend(charsetRule);
|
||||
}
|
||||
}
|
||||
},
|
||||
};
|
||||
}
|
||||
|
||||
pluginCreator.postcss = true;
|
||||
module.exports = pluginCreator;
|
17
node_modules/postcss-normalize-charset/types/index.d.ts
generated
vendored
Normal file
17
node_modules/postcss-normalize-charset/types/index.d.ts
generated
vendored
Normal file
@ -0,0 +1,17 @@
|
||||
export = pluginCreator;
|
||||
/**
|
||||
* @typedef {{add?: boolean}} Options
|
||||
*/
|
||||
/**
|
||||
* @type {import('postcss').PluginCreator<Options>}
|
||||
* @param {Options} opts
|
||||
* @return {import('postcss').Plugin}
|
||||
*/
|
||||
declare function pluginCreator(opts?: Options): import('postcss').Plugin;
|
||||
declare namespace pluginCreator {
|
||||
export { postcss, Options };
|
||||
}
|
||||
type Options = {
|
||||
add?: boolean;
|
||||
};
|
||||
declare var postcss: true;
|
Reference in New Issue
Block a user