Website Structure
This commit is contained in:
parent
62812f2090
commit
71f0676a62
22365 changed files with 4265753 additions and 791 deletions
22
Frontend-Learner/node_modules/postcss-colormin/LICENSE-MIT
generated
vendored
Normal file
22
Frontend-Learner/node_modules/postcss-colormin/LICENSE-MIT
generated
vendored
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
Copyright (c) Ben Briggs <beneb.info@gmail.com> (http://beneb.info)
|
||||
|
||||
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.
|
||||
45
Frontend-Learner/node_modules/postcss-colormin/README.md
generated
vendored
Normal file
45
Frontend-Learner/node_modules/postcss-colormin/README.md
generated
vendored
Normal file
|
|
@ -0,0 +1,45 @@
|
|||
# [postcss][postcss]-colormin
|
||||
|
||||
> Minify colors in your CSS files with PostCSS.
|
||||
|
||||
## Install
|
||||
|
||||
With [npm](https://npmjs.org/package/postcss-colormin) do:
|
||||
|
||||
```
|
||||
npm install postcss-colormin --save
|
||||
```
|
||||
|
||||
|
||||
## Example
|
||||
|
||||
```js
|
||||
var postcss = require('postcss')
|
||||
var colormin = require('postcss-colormin');
|
||||
|
||||
var css = 'h1 {color: rgba(255, 0, 0, 1)}';
|
||||
console.log(postcss(colormin()).process(css).css);
|
||||
|
||||
// => 'h1 {color:red}'
|
||||
```
|
||||
|
||||
For more examples see the [tests](src/__tests__/index.js).
|
||||
|
||||
|
||||
## 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 © [Ben Briggs](http://beneb.info)
|
||||
|
||||
|
||||
[postcss]: https://github.com/postcss/postcss
|
||||
48
Frontend-Learner/node_modules/postcss-colormin/package.json
generated
vendored
Normal file
48
Frontend-Learner/node_modules/postcss-colormin/package.json
generated
vendored
Normal file
|
|
@ -0,0 +1,48 @@
|
|||
{
|
||||
"name": "postcss-colormin",
|
||||
"version": "7.0.5",
|
||||
"description": "Minify colors in your CSS files with PostCSS.",
|
||||
"main": "src/index.js",
|
||||
"types": "types/index.d.ts",
|
||||
"files": [
|
||||
"src",
|
||||
"LICENSE-MIT",
|
||||
"types"
|
||||
],
|
||||
"keywords": [
|
||||
"color",
|
||||
"colors",
|
||||
"compression",
|
||||
"css",
|
||||
"minify",
|
||||
"postcss",
|
||||
"postcss-plugin"
|
||||
],
|
||||
"license": "MIT",
|
||||
"homepage": "https://github.com/cssnano/cssnano",
|
||||
"author": {
|
||||
"name": "Ben Briggs",
|
||||
"email": "beneb.info@gmail.com",
|
||||
"url": "http://beneb.info"
|
||||
},
|
||||
"repository": "cssnano/cssnano",
|
||||
"dependencies": {
|
||||
"browserslist": "^4.27.0",
|
||||
"caniuse-api": "^3.0.0",
|
||||
"colord": "^2.9.3",
|
||||
"postcss-value-parser": "^4.2.0"
|
||||
},
|
||||
"bugs": {
|
||||
"url": "https://github.com/cssnano/cssnano/issues"
|
||||
},
|
||||
"engines": {
|
||||
"node": "^18.12.0 || ^20.9.0 || >=22.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/caniuse-api": "^3.0.6",
|
||||
"postcss": "^8.5.6"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"postcss": "^8.4.32"
|
||||
}
|
||||
}
|
||||
179
Frontend-Learner/node_modules/postcss-colormin/src/index.js
generated
vendored
Normal file
179
Frontend-Learner/node_modules/postcss-colormin/src/index.js
generated
vendored
Normal file
|
|
@ -0,0 +1,179 @@
|
|||
'use strict';
|
||||
const { dirname } = require('path');
|
||||
const browserslist = require('browserslist');
|
||||
const { isSupported } = require('caniuse-api');
|
||||
const valueParser = require('postcss-value-parser');
|
||||
const minifyColor = require('./minifyColor');
|
||||
|
||||
/**
|
||||
* @param {{nodes: valueParser.Node[]}} parent
|
||||
* @param {(node: valueParser.Node, index: number, parent: {nodes: valueParser.Node[]}) => false | undefined} callback
|
||||
* @return {void}
|
||||
*/
|
||||
function walk(parent, callback) {
|
||||
parent.nodes.forEach((node, index) => {
|
||||
const bubble = callback(node, index, parent);
|
||||
|
||||
if (node.type === 'function' && bubble !== false) {
|
||||
walk(node, callback);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/*
|
||||
* IE 8 & 9 do not properly handle clicks on elements
|
||||
* with a `transparent` `background-color`.
|
||||
*
|
||||
* https://developer.mozilla.org/en-US/docs/Web/Events/click#Internet_Explorer
|
||||
*/
|
||||
const browsersWithTransparentBug = new Set(['ie 8', 'ie 9']);
|
||||
const mathFunctions = new Set(['calc', 'min', 'max', 'clamp']);
|
||||
|
||||
/**
|
||||
* @param {valueParser.Node} node
|
||||
* @return {boolean}
|
||||
*/
|
||||
function isMathFunctionNode(node) {
|
||||
if (node.type !== 'function') {
|
||||
return false;
|
||||
}
|
||||
return mathFunctions.has(node.value.toLowerCase());
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {string} value
|
||||
* @param {Options} options
|
||||
* @return {string}
|
||||
*/
|
||||
function transform(value, options) {
|
||||
const parsed = valueParser(value);
|
||||
|
||||
walk(parsed, (node, index, parent) => {
|
||||
if (node.type === 'function') {
|
||||
if (/^(rgb|hsl)a?$/i.test(node.value)) {
|
||||
const { value: originalValue } = node;
|
||||
|
||||
node.value = minifyColor(valueParser.stringify(node), options);
|
||||
/** @type {string} */ (node.type) = 'word';
|
||||
|
||||
const next = parent.nodes[index + 1];
|
||||
|
||||
if (
|
||||
node.value !== originalValue &&
|
||||
next &&
|
||||
(next.type === 'word' || next.type === 'function')
|
||||
) {
|
||||
parent.nodes.splice(
|
||||
index + 1,
|
||||
0,
|
||||
/** @type {valueParser.SpaceNode} */ ({
|
||||
type: 'space',
|
||||
value: ' ',
|
||||
})
|
||||
);
|
||||
}
|
||||
} else if (isMathFunctionNode(node)) {
|
||||
return false;
|
||||
}
|
||||
} else if (node.type === 'word') {
|
||||
node.value = minifyColor(node.value, options);
|
||||
}
|
||||
});
|
||||
|
||||
return parsed.toString();
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {Options} options
|
||||
* @param {string[]} browsers
|
||||
* @return {Options}
|
||||
*/
|
||||
function addPluginDefaults(options, browsers) {
|
||||
const defaults = {
|
||||
// Does the browser support 4 & 8 character hex notation
|
||||
transparent:
|
||||
browsers.some((b) => browsersWithTransparentBug.has(b)) === false,
|
||||
// Does the browser support "transparent" value properly
|
||||
alphaHex: isSupported('css-rrggbbaa', browsers),
|
||||
name: true,
|
||||
};
|
||||
return { ...defaults, ...options };
|
||||
}
|
||||
|
||||
/**
|
||||
* @typedef {object} MinifyColorOptions
|
||||
* @property {boolean} [hex]
|
||||
* @property {boolean} [alphaHex]
|
||||
* @property {boolean} [rgb]
|
||||
* @property {boolean} [hsl]
|
||||
* @property {boolean} [name]
|
||||
* @property {boolean} [transparent]
|
||||
*/
|
||||
|
||||
/**
|
||||
* @typedef {{ overrideBrowserslist?: string | string[] }} AutoprefixerOptions
|
||||
* @typedef {Pick<browserslist.Options, 'stats' | 'path' | 'env'>} BrowserslistOptions
|
||||
* @typedef {MinifyColorOptions & AutoprefixerOptions & BrowserslistOptions} Options
|
||||
*/
|
||||
|
||||
/**
|
||||
* @type {import('postcss').PluginCreator<Options>}
|
||||
* @param {Options} config
|
||||
* @return {import('postcss').Plugin}
|
||||
*/
|
||||
function pluginCreator(config = {}) {
|
||||
return {
|
||||
postcssPlugin: 'postcss-colormin',
|
||||
|
||||
/**
|
||||
* @param {import('postcss').Result & {opts: BrowserslistOptions & {file?: string}}} result
|
||||
*/
|
||||
prepare(result) {
|
||||
const { stats, env, from, file } = result.opts || {};
|
||||
const browsers = browserslist(config.overrideBrowserslist, {
|
||||
stats: config.stats || stats,
|
||||
path: config.path || dirname(from || file || __filename),
|
||||
env: config.env || env,
|
||||
});
|
||||
|
||||
const cache = new Map();
|
||||
const options = addPluginDefaults(config, browsers);
|
||||
|
||||
return {
|
||||
OnceExit(css) {
|
||||
css.walkDecls((decl) => {
|
||||
if (
|
||||
/^(composes|font|src$|filter|-webkit-tap-highlight-color)/i.test(
|
||||
decl.prop
|
||||
)
|
||||
) {
|
||||
return;
|
||||
}
|
||||
|
||||
const value = decl.value;
|
||||
|
||||
if (!value) {
|
||||
return;
|
||||
}
|
||||
|
||||
const cacheKey = JSON.stringify({ value, options, browsers });
|
||||
|
||||
if (cache.has(cacheKey)) {
|
||||
decl.value = cache.get(cacheKey);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
const newValue = transform(value, options);
|
||||
|
||||
decl.value = newValue;
|
||||
cache.set(cacheKey, newValue);
|
||||
});
|
||||
},
|
||||
};
|
||||
},
|
||||
};
|
||||
}
|
||||
|
||||
pluginCreator.postcss = true;
|
||||
module.exports = pluginCreator;
|
||||
28
Frontend-Learner/node_modules/postcss-colormin/src/minifyColor.js
generated
vendored
Normal file
28
Frontend-Learner/node_modules/postcss-colormin/src/minifyColor.js
generated
vendored
Normal file
|
|
@ -0,0 +1,28 @@
|
|||
'use strict';
|
||||
const { colord, extend } = require('colord');
|
||||
const namesPlugin = require('colord/plugins/names');
|
||||
const minifierPlugin = require('colord/plugins/minify');
|
||||
|
||||
extend(/** @type {any[]} */ ([namesPlugin, minifierPlugin]));
|
||||
|
||||
/**
|
||||
* Performs color value minification
|
||||
*
|
||||
* @param {string} input - CSS value
|
||||
* @param {import('./index.js').MinifyColorOptions} options - object with colord.minify() options
|
||||
* @return {string}
|
||||
*/
|
||||
module.exports = function minifyColor(input, options = {}) {
|
||||
const instance = colord(input);
|
||||
|
||||
if (instance.isValid()) {
|
||||
// Try to shorten the string if it is a valid CSS color value
|
||||
const minified = instance.minify(options);
|
||||
|
||||
// Fall back to the original input if it's smaller or has equal length
|
||||
return minified.length < input.length ? minified : input.toLowerCase();
|
||||
} else {
|
||||
// Possibly malformed, so pass through
|
||||
return input;
|
||||
}
|
||||
};
|
||||
40
Frontend-Learner/node_modules/postcss-colormin/types/index.d.ts
generated
vendored
Normal file
40
Frontend-Learner/node_modules/postcss-colormin/types/index.d.ts
generated
vendored
Normal file
|
|
@ -0,0 +1,40 @@
|
|||
export = pluginCreator;
|
||||
/**
|
||||
* @typedef {object} MinifyColorOptions
|
||||
* @property {boolean} [hex]
|
||||
* @property {boolean} [alphaHex]
|
||||
* @property {boolean} [rgb]
|
||||
* @property {boolean} [hsl]
|
||||
* @property {boolean} [name]
|
||||
* @property {boolean} [transparent]
|
||||
*/
|
||||
/**
|
||||
* @typedef {{ overrideBrowserslist?: string | string[] }} AutoprefixerOptions
|
||||
* @typedef {Pick<browserslist.Options, 'stats' | 'path' | 'env'>} BrowserslistOptions
|
||||
* @typedef {MinifyColorOptions & AutoprefixerOptions & BrowserslistOptions} Options
|
||||
*/
|
||||
/**
|
||||
* @type {import('postcss').PluginCreator<Options>}
|
||||
* @param {Options} config
|
||||
* @return {import('postcss').Plugin}
|
||||
*/
|
||||
declare function pluginCreator(config?: Options): import("postcss").Plugin;
|
||||
declare namespace pluginCreator {
|
||||
export { postcss, MinifyColorOptions, AutoprefixerOptions, BrowserslistOptions, Options };
|
||||
}
|
||||
declare var postcss: true;
|
||||
type MinifyColorOptions = {
|
||||
hex?: boolean | undefined;
|
||||
alphaHex?: boolean | undefined;
|
||||
rgb?: boolean | undefined;
|
||||
hsl?: boolean | undefined;
|
||||
name?: boolean | undefined;
|
||||
transparent?: boolean | undefined;
|
||||
};
|
||||
type AutoprefixerOptions = {
|
||||
overrideBrowserslist?: string | string[];
|
||||
};
|
||||
type BrowserslistOptions = Pick<browserslist.Options, "stats" | "path" | "env">;
|
||||
type Options = MinifyColorOptions & AutoprefixerOptions & BrowserslistOptions;
|
||||
import browserslist = require("browserslist");
|
||||
//# sourceMappingURL=index.d.ts.map
|
||||
1
Frontend-Learner/node_modules/postcss-colormin/types/index.d.ts.map
generated
vendored
Normal file
1
Frontend-Learner/node_modules/postcss-colormin/types/index.d.ts.map
generated
vendored
Normal file
|
|
@ -0,0 +1 @@
|
|||
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.js"],"names":[],"mappings":";AAsGA;;;;;;;;GAQG;AAEH;;;;GAIG;AAEH;;;;GAIG;AACH,wCAHW,OAAO,GACN,OAAO,SAAS,EAAE,MAAM,CAsDnC;;;;;;;;;;;;;2BA9DY;IAAE,oBAAoB,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,CAAA;CAAE;2BAC5C,IAAI,CAAC,YAAY,CAAC,OAAO,EAAE,OAAO,GAAG,MAAM,GAAG,KAAK,CAAC;eACpD,kBAAkB,GAAG,mBAAmB,GAAG,mBAAmB"}
|
||||
3
Frontend-Learner/node_modules/postcss-colormin/types/minifyColor.d.ts
generated
vendored
Normal file
3
Frontend-Learner/node_modules/postcss-colormin/types/minifyColor.d.ts
generated
vendored
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
declare function _exports(input: string, options?: import("./index.js").MinifyColorOptions): string;
|
||||
export = _exports;
|
||||
//# sourceMappingURL=minifyColor.d.ts.map
|
||||
1
Frontend-Learner/node_modules/postcss-colormin/types/minifyColor.d.ts.map
generated
vendored
Normal file
1
Frontend-Learner/node_modules/postcss-colormin/types/minifyColor.d.ts.map
generated
vendored
Normal file
|
|
@ -0,0 +1 @@
|
|||
{"version":3,"file":"minifyColor.d.ts","sourceRoot":"","sources":["../src/minifyColor.js"],"names":[],"mappings":"AAciB,iCAJN,MAAM,YACN,OAAO,YAAY,EAAE,kBAAkB,GACtC,MAAM,CAejB"}
|
||||
Loading…
Add table
Add a link
Reference in a new issue