flow like the river
This commit is contained in:
commit
013fe673f3
42435 changed files with 5764238 additions and 0 deletions
152
BACK_BACK/node_modules/postcss-convert-values/CHANGELOG.md
generated
vendored
Executable file
152
BACK_BACK/node_modules/postcss-convert-values/CHANGELOG.md
generated
vendored
Executable file
|
|
@ -0,0 +1,152 @@
|
|||
# 4.0.0-rc.0
|
||||
|
||||
* Breaking: Drops support for Node 0.12, we now require at least Node 4.
|
||||
* Breaking: Update PostCSS to 6.0.0.
|
||||
* Breaking: Removes the deprecated options from version 2.2.0.
|
||||
|
||||
# 2.6.1
|
||||
|
||||
* Resolves an issue where IE hacks were being removed from `0` values
|
||||
(thanks to @Justineo).
|
||||
|
||||
# 2.6.0
|
||||
|
||||
* Added clamping of the values for the `shape-image-threshold` property, using
|
||||
the same logic as introduced in version `2.5.0`.
|
||||
|
||||
# 2.5.0
|
||||
|
||||
* Added clamping of the values for the `opacity` property to the `0-1` range.
|
||||
For example, this will convert `opacity: 1.1` to `opacity: 1`.
|
||||
|
||||
# 2.4.1
|
||||
|
||||
* Resolves an issue where the units would be stripped from zero values in
|
||||
custom properties (thanks to @jgerigmeyer).
|
||||
|
||||
# 2.4.0
|
||||
|
||||
* Added a `precision` option to enable rounding of decimal places for
|
||||
`px` values.
|
||||
|
||||
# 2.3.6
|
||||
|
||||
* Resolves an issue with the last patch where `height: 0em` was not being
|
||||
converted to `height: 0`.
|
||||
|
||||
# 2.3.5
|
||||
|
||||
* Resolves an issue where certain properties inside `@keyframes` rules would
|
||||
break animation in IE due to the percentage being stripped. Now, the
|
||||
percentage is preserved for these properties.
|
||||
|
||||
# 2.3.4
|
||||
|
||||
* Does not convert `height:0%` to `height:0` (and the same for `max-height`), as
|
||||
they produce different results.
|
||||
|
||||
# 2.3.3
|
||||
|
||||
* Updates postcss-value-parser to version 3 (thanks to @TrySound).
|
||||
|
||||
# 2.3.2
|
||||
|
||||
* Fixed a regression where `0%` in color functions was being transformed to `0`
|
||||
(thanks to @TrySound).
|
||||
|
||||
# 2.3.1
|
||||
|
||||
* Fixed a behaviour where `0deg` was being converted to `0`.
|
||||
|
||||
# 2.3.0
|
||||
|
||||
* Added an option to convert between `turn` & `deg` (thanks to @TrySound).
|
||||
|
||||
# 2.2.1
|
||||
|
||||
* Fixes a behaviour where the module would remove units from zero values inside
|
||||
calc functions (thanks to @marek-saji & @TrySound).
|
||||
|
||||
# 2.2.0
|
||||
|
||||
* Renames `opts.convertLength` & `opts.convertTime` to
|
||||
`opts.length` & `opts.time`; the old options will now print deprecation
|
||||
warnings (thanks to @TrySound).
|
||||
|
||||
# 2.1.0
|
||||
|
||||
* Adds options to enable/disable unit conversion for time & length values.
|
||||
|
||||
# 2.0.1
|
||||
|
||||
* Bump postcss-value-parser to `2.0.2`.
|
||||
|
||||
# 2.0.0
|
||||
|
||||
* Upgraded to PostCSS 5.
|
||||
|
||||
# 1.3.1
|
||||
|
||||
* Fixes an issue where the module would convert values in gradient/url functions
|
||||
since 1.3.0.
|
||||
|
||||
# 1.3.0
|
||||
|
||||
* Converted the module to use ES6.
|
||||
* balanced-match, css-list & some integrated code has been replaced with
|
||||
postcss-value-parser; reducing the number of moving parts in this module, and
|
||||
providing a more futureproof way of parsing CSS numeric values.
|
||||
|
||||
# 1.2.5
|
||||
|
||||
* Fixes an issue where uppercase units (such as PX) were being deleted.
|
||||
|
||||
# 1.2.4
|
||||
|
||||
* Fixes convert not px or ms
|
||||
|
||||
# 1.2.3
|
||||
|
||||
* Adds support for `ch` units; previously they were removed.
|
||||
* Upgrades css-list to `0.1.0`, code tidied up.
|
||||
|
||||
# 1.2.2
|
||||
|
||||
* Added support for viewport units (thanks to @TrySound).
|
||||
|
||||
# 1.2.1
|
||||
|
||||
* Fixes regressions introduced by the previous patch. Better support for
|
||||
negative value transforms.
|
||||
|
||||
# 1.2.0
|
||||
|
||||
* Adds support for slash/comma separated values (thanks to @TrySound).
|
||||
|
||||
# 1.1.1
|
||||
|
||||
* Fixes an issue where trailing zeroes were not being removed in
|
||||
values that were not `0` (thanks to @TrySound).
|
||||
|
||||
# 1.1.0
|
||||
|
||||
* Adds support for removing leading zeroes from `rem` values
|
||||
(thanks to @tunnckoCore).
|
||||
|
||||
# 1.0.3
|
||||
|
||||
* Fixed a bug where filenames were being incorrectly transformed.
|
||||
|
||||
# 1.0.2
|
||||
|
||||
* Fixed a bug where `1.` and `.0` were not being optimised to `1` and `0`,
|
||||
respectively.
|
||||
|
||||
# 1.0.1
|
||||
|
||||
* Fixed a bug where `undefined` would be stringified as the unit value, if the
|
||||
value did not have a unit.
|
||||
|
||||
# 1.0.0
|
||||
|
||||
* Initial release.
|
||||
22
BACK_BACK/node_modules/postcss-convert-values/LICENSE-MIT
generated
vendored
Executable file
22
BACK_BACK/node_modules/postcss-convert-values/LICENSE-MIT
generated
vendored
Executable 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.
|
||||
98
BACK_BACK/node_modules/postcss-convert-values/README.md
generated
vendored
Executable file
98
BACK_BACK/node_modules/postcss-convert-values/README.md
generated
vendored
Executable file
|
|
@ -0,0 +1,98 @@
|
|||
# [postcss][postcss]-convert-values
|
||||
|
||||
> Convert values with PostCSS (e.g. ms -> s)
|
||||
|
||||
## Install
|
||||
|
||||
With [npm](https://npmjs.org/package/postcss-convert-values) do:
|
||||
|
||||
```
|
||||
npm install postcss-convert-values --save
|
||||
```
|
||||
|
||||
## Example
|
||||
|
||||
This plugin reduces CSS size by converting values to use different units
|
||||
where possible; for example, `500ms` can be represented as `.5s`. You can
|
||||
read more about these units in [this article][csstricks].
|
||||
|
||||
### Input
|
||||
|
||||
```css
|
||||
h1 {
|
||||
font-size: 16px;
|
||||
width: 0em
|
||||
}
|
||||
```
|
||||
|
||||
### Output
|
||||
|
||||
```css
|
||||
h1 {
|
||||
font-size: 1pc;
|
||||
width: 0
|
||||
}
|
||||
```
|
||||
|
||||
Note that this plugin only covers conversions for duration and absolute length
|
||||
values. For color conversions, use [postcss-colormin][colormin].
|
||||
|
||||
## API
|
||||
|
||||
### convertValues([options])
|
||||
|
||||
#### options
|
||||
|
||||
##### length
|
||||
|
||||
Type: `boolean`
|
||||
Default: `true`
|
||||
|
||||
Pass `false` to disable conversion from `px` to other absolute length units,
|
||||
such as `pc` & `pt` & vice versa.
|
||||
|
||||
##### time
|
||||
|
||||
Type: `boolean`
|
||||
Default: `true`
|
||||
|
||||
Pass `false` to disable conversion from `ms` to `s` & vice versa.
|
||||
|
||||
##### angle
|
||||
|
||||
Type: `boolean`
|
||||
Default: `true`
|
||||
|
||||
Pass `false` to disable conversion from `deg` to `turn` & vice versa.
|
||||
|
||||
##### precision
|
||||
|
||||
Type: `boolean|number`
|
||||
Default: `false`
|
||||
|
||||
Specify any numeric value here to round `px` values to that many decimal places;
|
||||
for example, using `{precision: 2}` will round `6.66667px` to `6.67px`, and
|
||||
`{precision: 0}` will round it to `7px`. Passing `false` (the default) will
|
||||
leave these values as is.
|
||||
|
||||
It is recommended for most use cases to set this option to `2`.
|
||||
|
||||
|
||||
## 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
|
||||
[csstricks]: https://css-tricks.com/the-lengths-of-css/
|
||||
95
BACK_BACK/node_modules/postcss-convert-values/dist/index.js
generated
vendored
Executable file
95
BACK_BACK/node_modules/postcss-convert-values/dist/index.js
generated
vendored
Executable file
|
|
@ -0,0 +1,95 @@
|
|||
'use strict';
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
|
||||
var _postcss = require('postcss');
|
||||
|
||||
var _postcss2 = _interopRequireDefault(_postcss);
|
||||
|
||||
var _postcssValueParser = require('postcss-value-parser');
|
||||
|
||||
var _postcssValueParser2 = _interopRequireDefault(_postcssValueParser);
|
||||
|
||||
var _convert = require('./lib/convert');
|
||||
|
||||
var _convert2 = _interopRequireDefault(_convert);
|
||||
|
||||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||||
|
||||
const LENGTH_UNITS = ['em', 'ex', 'ch', 'rem', 'vw', 'vh', 'vmin', 'vmax', 'cm', 'mm', 'q', 'in', 'pt', 'pc', 'px'];
|
||||
|
||||
function parseWord(node, opts, keepZeroUnit) {
|
||||
const pair = (0, _postcssValueParser.unit)(node.value);
|
||||
if (pair) {
|
||||
const num = Number(pair.number);
|
||||
const u = pair.unit;
|
||||
if (num === 0) {
|
||||
node.value = keepZeroUnit || !~LENGTH_UNITS.indexOf(u.toLowerCase()) && u !== '%' ? 0 + u : 0;
|
||||
} else {
|
||||
node.value = (0, _convert2.default)(num, u, opts);
|
||||
|
||||
if (typeof opts.precision === 'number' && u.toLowerCase() === 'px' && ~pair.number.indexOf('.')) {
|
||||
const precision = Math.pow(10, opts.precision);
|
||||
node.value = Math.round(parseFloat(node.value) * precision) / precision + u;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function clampOpacity(node) {
|
||||
const pair = (0, _postcssValueParser.unit)(node.value);
|
||||
if (!pair) {
|
||||
return;
|
||||
}
|
||||
let num = Number(pair.number);
|
||||
if (num > 1) {
|
||||
node.value = 1 + pair.unit;
|
||||
} else if (num < 0) {
|
||||
node.value = 0 + pair.unit;
|
||||
}
|
||||
}
|
||||
|
||||
function shouldStripPercent(decl) {
|
||||
const { parent } = decl;
|
||||
const lowerCasedProp = decl.prop.toLowerCase();
|
||||
return ~decl.value.indexOf('%') && (lowerCasedProp === 'max-height' || lowerCasedProp === 'height') || parent.parent && parent.parent.name && parent.parent.name.toLowerCase() === 'keyframes' && lowerCasedProp === 'stroke-dasharray' || lowerCasedProp === 'stroke-dashoffset' || lowerCasedProp === 'stroke-width';
|
||||
}
|
||||
|
||||
function transform(opts, decl) {
|
||||
const lowerCasedProp = decl.prop.toLowerCase();
|
||||
if (~lowerCasedProp.indexOf('flex') || lowerCasedProp.indexOf('--') === 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
decl.value = (0, _postcssValueParser2.default)(decl.value).walk(node => {
|
||||
const lowerCasedValue = node.value.toLowerCase();
|
||||
|
||||
if (node.type === 'word') {
|
||||
parseWord(node, opts, shouldStripPercent(decl));
|
||||
if (lowerCasedProp === 'opacity' || lowerCasedProp === 'shape-image-threshold') {
|
||||
clampOpacity(node);
|
||||
}
|
||||
} else if (node.type === 'function') {
|
||||
if (lowerCasedValue === 'calc' || lowerCasedValue === 'hsl' || lowerCasedValue === 'hsla') {
|
||||
(0, _postcssValueParser.walk)(node.nodes, n => {
|
||||
if (n.type === 'word') {
|
||||
parseWord(n, opts, true);
|
||||
}
|
||||
});
|
||||
return false;
|
||||
}
|
||||
if (lowerCasedValue === 'url') {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}).toString();
|
||||
}
|
||||
|
||||
const plugin = 'postcss-convert-values';
|
||||
|
||||
exports.default = _postcss2.default.plugin(plugin, (opts = { precision: false }) => {
|
||||
return css => css.walkDecls(transform.bind(null, opts));
|
||||
});
|
||||
module.exports = exports['default'];
|
||||
82
BACK_BACK/node_modules/postcss-convert-values/dist/lib/convert.js
generated
vendored
Executable file
82
BACK_BACK/node_modules/postcss-convert-values/dist/lib/convert.js
generated
vendored
Executable file
|
|
@ -0,0 +1,82 @@
|
|||
'use strict';
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
|
||||
exports.default = function (number, unit, { time, length, angle }) {
|
||||
let value = dropLeadingZero(number) + (unit ? unit : '');
|
||||
let converted;
|
||||
|
||||
if (length !== false && unit.toLowerCase() in lengthConv) {
|
||||
converted = transform(number, unit, lengthConv);
|
||||
}
|
||||
|
||||
if (time !== false && unit.toLowerCase() in timeConv) {
|
||||
converted = transform(number, unit, timeConv);
|
||||
}
|
||||
|
||||
if (angle !== false && unit.toLowerCase() in angleConv) {
|
||||
converted = transform(number, unit, angleConv);
|
||||
}
|
||||
|
||||
if (converted && converted.length < value.length) {
|
||||
value = converted;
|
||||
}
|
||||
|
||||
return value;
|
||||
};
|
||||
|
||||
const lengthConv = {
|
||||
in: 96,
|
||||
px: 1,
|
||||
pt: 4 / 3,
|
||||
pc: 16
|
||||
};
|
||||
|
||||
const timeConv = {
|
||||
s: 1000,
|
||||
ms: 1
|
||||
};
|
||||
|
||||
const angleConv = {
|
||||
turn: 360,
|
||||
deg: 1
|
||||
};
|
||||
|
||||
function dropLeadingZero(number) {
|
||||
const value = String(number);
|
||||
|
||||
if (number % 1) {
|
||||
if (value[0] === '0') {
|
||||
return value.slice(1);
|
||||
}
|
||||
|
||||
if (value[0] === '-' && value[1] === '0') {
|
||||
return '-' + value.slice(2);
|
||||
}
|
||||
}
|
||||
|
||||
return value;
|
||||
}
|
||||
|
||||
function transform(number, unit, conversion) {
|
||||
const lowerCasedUnit = unit.toLowerCase();
|
||||
let one, base;
|
||||
let convertionUnits = Object.keys(conversion).filter(u => {
|
||||
if (conversion[u] === 1) {
|
||||
one = u;
|
||||
}
|
||||
return lowerCasedUnit !== u;
|
||||
});
|
||||
|
||||
if (lowerCasedUnit === one) {
|
||||
base = number / conversion[lowerCasedUnit];
|
||||
} else {
|
||||
base = number * conversion[lowerCasedUnit];
|
||||
}
|
||||
|
||||
return convertionUnits.map(u => dropLeadingZero(base / conversion[u]) + u).reduce((a, b) => a.length < b.length ? a : b);
|
||||
}
|
||||
|
||||
module.exports = exports['default'];
|
||||
41
BACK_BACK/node_modules/postcss-convert-values/package.json
generated
vendored
Executable file
41
BACK_BACK/node_modules/postcss-convert-values/package.json
generated
vendored
Executable file
|
|
@ -0,0 +1,41 @@
|
|||
{
|
||||
"name": "postcss-convert-values",
|
||||
"version": "4.0.1",
|
||||
"description": "Convert values with PostCSS (e.g. ms -> s)",
|
||||
"main": "dist/index.js",
|
||||
"files": [
|
||||
"LICENSE-MIT",
|
||||
"dist"
|
||||
],
|
||||
"scripts": {
|
||||
"prepublish": "cross-env BABEL_ENV=publish babel src --out-dir dist --ignore /__tests__/"
|
||||
},
|
||||
"keywords": [
|
||||
"css",
|
||||
"optimisation",
|
||||
"postcss",
|
||||
"postcss-plugin"
|
||||
],
|
||||
"license": "MIT",
|
||||
"devDependencies": {
|
||||
"babel-cli": "^6.0.0",
|
||||
"cross-env": "^5.0.0"
|
||||
},
|
||||
"homepage": "https://github.com/cssnano/cssnano",
|
||||
"author": {
|
||||
"name": "Ben Briggs",
|
||||
"email": "beneb.info@gmail.com",
|
||||
"url": "http://beneb.info"
|
||||
},
|
||||
"repository": "cssnano/cssnano",
|
||||
"dependencies": {
|
||||
"postcss": "^7.0.0",
|
||||
"postcss-value-parser": "^3.0.0"
|
||||
},
|
||||
"bugs": {
|
||||
"url": "https://github.com/cssnano/cssnano/issues"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=6.9.0"
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue