flow like the river
This commit is contained in:
commit
013fe673f3
42435 changed files with 5764238 additions and 0 deletions
22
BACK_BACK/node_modules/postcss-normalize-repeat-style/LICENSE-MIT
generated
vendored
Executable file
22
BACK_BACK/node_modules/postcss-normalize-repeat-style/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.
|
||||
44
BACK_BACK/node_modules/postcss-normalize-repeat-style/README.md
generated
vendored
Executable file
44
BACK_BACK/node_modules/postcss-normalize-repeat-style/README.md
generated
vendored
Executable file
|
|
@ -0,0 +1,44 @@
|
|||
# [postcss][postcss]-normalize-repeat-style
|
||||
|
||||
> Normalize repeat styles with PostCSS.
|
||||
|
||||
## Install
|
||||
|
||||
With [npm](https://npmjs.org/package/postcss-normalize-repeat-style) do:
|
||||
|
||||
```
|
||||
npm install postcss-normalize-repeat-style --save
|
||||
```
|
||||
|
||||
## Example
|
||||
|
||||
### Input
|
||||
|
||||
```css
|
||||
h1 {
|
||||
background: url(image.jpg) repeat no-repeat
|
||||
}
|
||||
```
|
||||
|
||||
### Output
|
||||
|
||||
```css
|
||||
h1 {
|
||||
background: url(image.jpg) repeat-x
|
||||
}
|
||||
```
|
||||
|
||||
## 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
|
||||
119
BACK_BACK/node_modules/postcss-normalize-repeat-style/dist/index.js
generated
vendored
Executable file
119
BACK_BACK/node_modules/postcss-normalize-repeat-style/dist/index.js
generated
vendored
Executable file
|
|
@ -0,0 +1,119 @@
|
|||
'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 _cssnanoUtilGetArguments = require('cssnano-util-get-arguments');
|
||||
|
||||
var _cssnanoUtilGetArguments2 = _interopRequireDefault(_cssnanoUtilGetArguments);
|
||||
|
||||
var _cssnanoUtilGetMatch = require('cssnano-util-get-match');
|
||||
|
||||
var _cssnanoUtilGetMatch2 = _interopRequireDefault(_cssnanoUtilGetMatch);
|
||||
|
||||
var _map = require('./lib/map');
|
||||
|
||||
var _map2 = _interopRequireDefault(_map);
|
||||
|
||||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||||
|
||||
function evenValues(list, index) {
|
||||
return index % 2 === 0;
|
||||
}
|
||||
|
||||
const repeatKeywords = _map2.default.map(mapping => mapping[0]);
|
||||
|
||||
const getMatch = (0, _cssnanoUtilGetMatch2.default)(_map2.default);
|
||||
|
||||
exports.default = _postcss2.default.plugin('postcss-normalize-repeat-style', () => {
|
||||
return css => {
|
||||
const cache = {};
|
||||
|
||||
css.walkDecls(/background(-repeat)?|(-webkit-)?mask-repeat/i, decl => {
|
||||
const value = decl.value;
|
||||
|
||||
if (cache[value]) {
|
||||
decl.value = cache[value];
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
const parsed = (0, _postcssValueParser2.default)(value);
|
||||
|
||||
if (parsed.nodes.length === 1) {
|
||||
cache[value] = value;
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
const args = (0, _cssnanoUtilGetArguments2.default)(parsed);
|
||||
const relevant = [];
|
||||
|
||||
args.forEach(arg => {
|
||||
relevant.push({
|
||||
start: null,
|
||||
end: null
|
||||
});
|
||||
|
||||
arg.forEach((part, index) => {
|
||||
const isRepeat = ~repeatKeywords.indexOf(part.value.toLowerCase());
|
||||
const len = relevant.length - 1;
|
||||
|
||||
if (relevant[len].start === null && isRepeat) {
|
||||
relevant[len].start = index;
|
||||
relevant[len].end = index;
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
if (relevant[len].start !== null) {
|
||||
if (part.type === 'space') {
|
||||
return;
|
||||
} else if (isRepeat) {
|
||||
relevant[len].end = index;
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
relevant.forEach((range, index) => {
|
||||
if (range.start === null) {
|
||||
return;
|
||||
}
|
||||
|
||||
const val = args[index].slice(range.start, range.end + 1);
|
||||
|
||||
if (val.length !== 3) {
|
||||
return;
|
||||
}
|
||||
|
||||
const match = getMatch(val.filter(evenValues).map(n => n.value.toLowerCase()));
|
||||
|
||||
if (match) {
|
||||
args[index][range.start].value = match;
|
||||
args[index][range.start + 1].value = '';
|
||||
args[index][range.end].value = '';
|
||||
}
|
||||
});
|
||||
|
||||
const result = parsed.toString();
|
||||
|
||||
decl.value = result;
|
||||
cache[value] = result;
|
||||
});
|
||||
};
|
||||
});
|
||||
module.exports = exports['default'];
|
||||
7
BACK_BACK/node_modules/postcss-normalize-repeat-style/dist/lib/map.js
generated
vendored
Executable file
7
BACK_BACK/node_modules/postcss-normalize-repeat-style/dist/lib/map.js
generated
vendored
Executable file
|
|
@ -0,0 +1,7 @@
|
|||
'use strict';
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.default = [['repeat-x', ['repeat', 'no-repeat']], ['repeat-y', ['no-repeat', 'repeat']], ['repeat', ['repeat', 'repeat']], ['space', ['space', 'space']], ['round', ['round', 'round']], ['no-repeat', ['no-repeat', 'no-repeat']]];
|
||||
module.exports = exports['default'];
|
||||
37
BACK_BACK/node_modules/postcss-normalize-repeat-style/package.json
generated
vendored
Executable file
37
BACK_BACK/node_modules/postcss-normalize-repeat-style/package.json
generated
vendored
Executable file
|
|
@ -0,0 +1,37 @@
|
|||
{
|
||||
"name": "postcss-normalize-repeat-style",
|
||||
"version": "4.0.2",
|
||||
"description": "Convert two value syntax for repeat-style into one value.",
|
||||
"main": "dist/index.js",
|
||||
"scripts": {
|
||||
"prepublish": "cross-env BABEL_ENV=publish babel src --out-dir dist --ignore /__tests__/"
|
||||
},
|
||||
"files": [
|
||||
"LICENSE-MIT",
|
||||
"dist"
|
||||
],
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"cssnano-util-get-arguments": "^4.0.0",
|
||||
"cssnano-util-get-match": "^4.0.0",
|
||||
"postcss": "^7.0.0",
|
||||
"postcss-value-parser": "^3.0.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"babel-cli": "^6.0.0",
|
||||
"cross-env": "^5.0.0"
|
||||
},
|
||||
"author": {
|
||||
"name": "Ben Briggs",
|
||||
"email": "beneb.info@gmail.com",
|
||||
"url": "http://beneb.info"
|
||||
},
|
||||
"repository": "cssnano/cssnano",
|
||||
"bugs": {
|
||||
"url": "https://github.com/cssnano/cssnano/issues"
|
||||
},
|
||||
"homepage": "https://github.com/cssnano/cssnano",
|
||||
"engines": {
|
||||
"node": ">=6.9.0"
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue