postcss 5.2.18 → 6.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of postcss might be problematic. Click here for more details.
- package/CHANGELOG.md +26 -3
- package/README.md +4 -17
- package/docs/source-maps.md +2 -0
- package/lib/at-rule.js +87 -115
- package/lib/comment.js +32 -60
- package/lib/container.js +66 -94
- package/lib/css-syntax-error.js +13 -28
- package/lib/declaration.js +69 -98
- package/lib/lazy-result.js +2 -6
- package/lib/map-generator.js +11 -4
- package/lib/node.js +128 -177
- package/lib/parse.js +2 -4
- package/lib/parser.js +48 -40
- package/lib/postcss.d.ts +1235 -1255
- package/lib/postcss.js +6 -6
- package/lib/previous-map.js +7 -12
- package/lib/processor.js +4 -4
- package/lib/root.js +5 -19
- package/lib/rule.js +72 -86
- package/lib/stringifier.js +4 -1
- package/lib/terminal-highlight.js +20 -11
- package/lib/tokenize.js +59 -26
- package/package.json +50 -20
package/CHANGELOG.md
CHANGED
@@ -1,9 +1,32 @@
|
|
1
1
|
# Change Log
|
2
2
|
This project adheres to [Semantic Versioning](http://semver.org/).
|
3
3
|
|
4
|
-
##
|
5
|
-
* Fix
|
6
|
-
|
4
|
+
## 6.0.3
|
5
|
+
* Fix escape sequences parsing (by Oleh Kuchuk).
|
6
|
+
* Added ability to force disable colors with an environment variable.
|
7
|
+
* Improved color detection of some terminal apps.
|
8
|
+
|
9
|
+
## 6.0.2
|
10
|
+
* Keep `raws.before` on moving `Root` children to new `Root`.
|
11
|
+
|
12
|
+
## 6.0.1
|
13
|
+
* Fix parser extensibility to use it in Safe Parser.
|
14
|
+
|
15
|
+
## 6.0 “Marquis Orias”
|
16
|
+
* Remove node.js 0.12 support.
|
17
|
+
* Remove deprecated method from PostCSS 4.
|
18
|
+
* Insert methods remove child from previous parent, instead of closing.
|
19
|
+
* Insert methods and cloning doesn’t clean `raws` anymore.
|
20
|
+
* Methods `moveTo`, `moveAfter`, `moveBefore` were deprecated.
|
21
|
+
* Options was changed in `Plugin#process(css, processOptions, pluginOptions)`.
|
22
|
+
* Add stream parser to reduce memory usage (by Oleh Kuchuk).
|
23
|
+
* Add `before()`/`after()` shortcuts for `node.parent.insertBefore(node, x)`.
|
24
|
+
* Add `Rule#raws.ownSemicolon` for semicolon after templates for `@apply`.
|
25
|
+
* Use `babel-preset-env` to compile npm package.
|
26
|
+
* Remove `js-base64` from dependencies (by Roman Dvornov).
|
27
|
+
* Fix error message on single `:` in CSS.
|
28
|
+
* Move tests to Jest.
|
29
|
+
* Clean up test (by Gabriel Kalani).
|
7
30
|
|
8
31
|
## 5.2.17
|
9
32
|
* Add `postcss-sass` suggestion to syntax error on `.sass` input.
|
package/README.md
CHANGED
@@ -134,6 +134,7 @@ If there is not yet support for your favorite syntax,
|
|
134
134
|
you can write a parser and/or stringifier to extend PostCSS.
|
135
135
|
|
136
136
|
* [`sugarss`] is a indent-based syntax like Sass or Stylus.
|
137
|
+
* [`postcss-html`] allows you to write styles in HTML / [Markdown](https://daringfireball.net/projects/markdown/syntax) / [Vue component](https://vue-loader.vuejs.org/)
|
137
138
|
* [`postcss-scss`] allows you to work with SCSS
|
138
139
|
*(but does not compile SCSS to CSS)*.
|
139
140
|
* [`postcss-sass`] allows you to work with Sass
|
@@ -148,6 +149,7 @@ you can write a parser and/or stringifier to extend PostCSS.
|
|
148
149
|
* [`midas`] converts a CSS string to highlighted HTML.
|
149
150
|
|
150
151
|
[`sugarss`]: https://github.com/postcss/sugarss
|
152
|
+
[`postcss-html`]: https://github.com/gucong3000/postcss-html
|
151
153
|
[`postcss-scss`]: https://github.com/postcss/postcss-scss
|
152
154
|
[`postcss-sass`]: https://github.com/AleshaOleg/postcss-sass
|
153
155
|
[`postcss-less`]: https://github.com/webschik/postcss-less
|
@@ -184,7 +186,7 @@ Use [`postcss-loader`] in `webpack.config.js`:
|
|
184
186
|
```js
|
185
187
|
module.exports = {
|
186
188
|
module: {
|
187
|
-
|
189
|
+
rules: [
|
188
190
|
{
|
189
191
|
test: /\.css$/,
|
190
192
|
exclude: /node_modules/,
|
@@ -195,15 +197,11 @@ module.exports = {
|
|
195
197
|
{
|
196
198
|
loader: 'css-loader',
|
197
199
|
options: {
|
198
|
-
sourceMap: true,
|
199
200
|
importLoaders: 1,
|
200
201
|
}
|
201
202
|
},
|
202
203
|
{
|
203
|
-
loader: 'postcss-loader'
|
204
|
-
options: {
|
205
|
-
sourceMap: 'inline',
|
206
|
-
}
|
204
|
+
loader: 'postcss-loader'
|
207
205
|
}
|
208
206
|
]
|
209
207
|
}
|
@@ -338,17 +336,6 @@ Common options:
|
|
338
336
|
[Midas]: https://github.com/ben-eb/midas
|
339
337
|
[SCSS]: https://github.com/postcss/postcss-scss
|
340
338
|
|
341
|
-
### Node.js 0.10 and the Promise API
|
342
|
-
|
343
|
-
If you want to run PostCSS in Node.js 0.10, add the [Promise polyfill]:
|
344
|
-
|
345
|
-
```js
|
346
|
-
require('es6-promise').polyfill();
|
347
|
-
var postcss = require('postcss');
|
348
|
-
```
|
349
|
-
|
350
|
-
[Promise polyfill]: https://github.com/jakearchibald/es6-promise
|
351
|
-
|
352
339
|
## Editors & IDE Integration
|
353
340
|
|
354
341
|
### Atom
|
package/docs/source-maps.md
CHANGED
@@ -68,5 +68,7 @@ option as an object with the following parameters:
|
|
68
68
|
* `from` string: by default, PostCSS will set the `sources` property of the map
|
69
69
|
to the value of the `from` option. If you want to override this behaviour, you
|
70
70
|
can use `map.from` to explicitly set the source map's `sources` property.
|
71
|
+
Path should be absolute or relative from generated file
|
72
|
+
(`to` option in `process()` method).
|
71
73
|
|
72
74
|
[source maps]: http://www.html5rocks.com/en/tutorials/developertools/sourcemaps/
|
package/lib/at-rule.js
CHANGED
@@ -2,16 +2,10 @@
|
|
2
2
|
|
3
3
|
exports.__esModule = true;
|
4
4
|
|
5
|
-
var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
|
6
|
-
|
7
5
|
var _container = require('./container');
|
8
6
|
|
9
7
|
var _container2 = _interopRequireDefault(_container);
|
10
8
|
|
11
|
-
var _warnOnce = require('./warn-once');
|
12
|
-
|
13
|
-
var _warnOnce2 = _interopRequireDefault(_warnOnce);
|
14
|
-
|
15
9
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
16
10
|
|
17
11
|
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
@@ -39,121 +33,99 @@ function _inherits(subClass, superClass) { if (typeof superClass !== "function"
|
|
39
33
|
* media.nodes //=> []
|
40
34
|
*/
|
41
35
|
var AtRule = function (_Container) {
|
42
|
-
|
36
|
+
_inherits(AtRule, _Container);
|
37
|
+
|
38
|
+
function AtRule(defaults) {
|
39
|
+
_classCallCheck(this, AtRule);
|
40
|
+
|
41
|
+
var _this = _possibleConstructorReturn(this, _Container.call(this, defaults));
|
42
|
+
|
43
|
+
_this.type = 'atrule';
|
44
|
+
return _this;
|
45
|
+
}
|
46
|
+
|
47
|
+
AtRule.prototype.append = function append() {
|
48
|
+
var _Container$prototype$;
|
49
|
+
|
50
|
+
if (!this.nodes) this.nodes = [];
|
51
|
+
|
52
|
+
for (var _len = arguments.length, children = Array(_len), _key = 0; _key < _len; _key++) {
|
53
|
+
children[_key] = arguments[_key];
|
54
|
+
}
|
55
|
+
|
56
|
+
return (_Container$prototype$ = _Container.prototype.append).call.apply(_Container$prototype$, [this].concat(children));
|
57
|
+
};
|
43
58
|
|
44
|
-
|
45
|
-
|
59
|
+
AtRule.prototype.prepend = function prepend() {
|
60
|
+
var _Container$prototype$2;
|
46
61
|
|
47
|
-
|
62
|
+
if (!this.nodes) this.nodes = [];
|
48
63
|
|
49
|
-
|
50
|
-
|
64
|
+
for (var _len2 = arguments.length, children = Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
|
65
|
+
children[_key2] = arguments[_key2];
|
51
66
|
}
|
52
67
|
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
* any {} block
|
113
|
-
*
|
114
|
-
* @example
|
115
|
-
* const root = postcss.parse('@media print, screen {}');
|
116
|
-
* const media = root.first;
|
117
|
-
* media.params //=> 'print, screen'
|
118
|
-
*/
|
119
|
-
|
120
|
-
/**
|
121
|
-
* @memberof AtRule#
|
122
|
-
* @member {object} raws - Information to generate byte-to-byte equal
|
123
|
-
* node string as it was in the origin input.
|
124
|
-
*
|
125
|
-
* Every parser saves its own properties,
|
126
|
-
* but the default CSS parser uses:
|
127
|
-
*
|
128
|
-
* * `before`: the space symbols before the node. It also stores `*`
|
129
|
-
* and `_` symbols before the declaration (IE hack).
|
130
|
-
* * `after`: the space symbols after the last child of the node
|
131
|
-
* to the end of the node.
|
132
|
-
* * `between`: the symbols between the property and value
|
133
|
-
* for declarations, selector and `{` for rules, or last parameter
|
134
|
-
* and `{` for at-rules.
|
135
|
-
* * `semicolon`: contains true if the last child has
|
136
|
-
* an (optional) semicolon.
|
137
|
-
* * `afterName`: the space between the at-rule name and its parameters.
|
138
|
-
*
|
139
|
-
* PostCSS cleans at-rule parameters from comments and extra spaces,
|
140
|
-
* but it stores origin content in raws properties.
|
141
|
-
* As such, if you don’t change a declaration’s value,
|
142
|
-
* PostCSS will use the raw value with comments.
|
143
|
-
*
|
144
|
-
* @example
|
145
|
-
* const root = postcss.parse(' @media\nprint {\n}')
|
146
|
-
* root.first.first.raws //=> { before: ' ',
|
147
|
-
* // between: ' ',
|
148
|
-
* // afterName: '\n',
|
149
|
-
* // after: '\n' }
|
150
|
-
*/
|
151
|
-
|
152
|
-
}]);
|
153
|
-
|
154
|
-
return AtRule;
|
68
|
+
return (_Container$prototype$2 = _Container.prototype.prepend).call.apply(_Container$prototype$2, [this].concat(children));
|
69
|
+
};
|
70
|
+
|
71
|
+
/**
|
72
|
+
* @memberof AtRule#
|
73
|
+
* @member {string} name - the at-rule’s name immediately follows the `@`
|
74
|
+
*
|
75
|
+
* @example
|
76
|
+
* const root = postcss.parse('@media print {}');
|
77
|
+
* media.name //=> 'media'
|
78
|
+
* const media = root.first;
|
79
|
+
*/
|
80
|
+
|
81
|
+
/**
|
82
|
+
* @memberof AtRule#
|
83
|
+
* @member {string} params - the at-rule’s parameters, the values
|
84
|
+
* that follow the at-rule’s name but precede
|
85
|
+
* any {} block
|
86
|
+
*
|
87
|
+
* @example
|
88
|
+
* const root = postcss.parse('@media print, screen {}');
|
89
|
+
* const media = root.first;
|
90
|
+
* media.params //=> 'print, screen'
|
91
|
+
*/
|
92
|
+
|
93
|
+
/**
|
94
|
+
* @memberof AtRule#
|
95
|
+
* @member {object} raws - Information to generate byte-to-byte equal
|
96
|
+
* node string as it was in the origin input.
|
97
|
+
*
|
98
|
+
* Every parser saves its own properties,
|
99
|
+
* but the default CSS parser uses:
|
100
|
+
*
|
101
|
+
* * `before`: the space symbols before the node. It also stores `*`
|
102
|
+
* and `_` symbols before the declaration (IE hack).
|
103
|
+
* * `after`: the space symbols after the last child of the node
|
104
|
+
* to the end of the node.
|
105
|
+
* * `between`: the symbols between the property and value
|
106
|
+
* for declarations, selector and `{` for rules, or last parameter
|
107
|
+
* and `{` for at-rules.
|
108
|
+
* * `semicolon`: contains true if the last child has
|
109
|
+
* an (optional) semicolon.
|
110
|
+
* * `afterName`: the space between the at-rule name and its parameters.
|
111
|
+
*
|
112
|
+
* PostCSS cleans at-rule parameters from comments and extra spaces,
|
113
|
+
* but it stores origin content in raws properties.
|
114
|
+
* As such, if you don’t change a declaration’s value,
|
115
|
+
* PostCSS will use the raw value with comments.
|
116
|
+
*
|
117
|
+
* @example
|
118
|
+
* const root = postcss.parse(' @media\nprint {\n}')
|
119
|
+
* root.first.first.raws //=> { before: ' ',
|
120
|
+
* // between: ' ',
|
121
|
+
* // afterName: '\n',
|
122
|
+
* // after: '\n' }
|
123
|
+
*/
|
124
|
+
|
125
|
+
|
126
|
+
return AtRule;
|
155
127
|
}(_container2.default);
|
156
128
|
|
157
129
|
exports.default = AtRule;
|
158
130
|
module.exports = exports['default'];
|
159
|
-
//# sourceMappingURL=data:application/json;charset=utf8;base64,
|
131
|
+
//# sourceMappingURL=data:application/json;charset=utf8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImF0LXJ1bGUuZXM2Il0sIm5hbWVzIjpbIkF0UnVsZSIsImRlZmF1bHRzIiwidHlwZSIsImFwcGVuZCIsIm5vZGVzIiwiY2hpbGRyZW4iLCJwcmVwZW5kIl0sIm1hcHBpbmdzIjoiOzs7O0FBQUE7Ozs7Ozs7Ozs7OztBQUVBOzs7Ozs7Ozs7Ozs7Ozs7Ozs7SUFrQk1BLE07OztBQUVGLGtCQUFZQyxRQUFaLEVBQXNCO0FBQUE7O0FBQUEsaURBQ2xCLHNCQUFNQSxRQUFOLENBRGtCOztBQUVsQixVQUFLQyxJQUFML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3cyAvLz0+IHsgYmVmb3JlOiAnICAnLFxuICAgICAqICAgICAgICAgICAgICAgICAgICAgICAvLyAgICAgYmV0d2VlbjogJyAnLFxuICAgICAqICAgICAgICAgICAgICAgICAgICAgICAvLyAgICAgYWZ0ZXJOYW1lOiAnXFxuJyxcbiAgICAgKiAgICAgICAgICAgICAgICAgICAgICAgLy8gICAgIGFmdGVyOiAnXFxuJyB9XG4gICAgICovXG59XG5cbmV4cG9ydCBkZWZhdWx0IEF0UnVsZTtcbiJdfQ==
|
package/lib/comment.js
CHANGED
@@ -2,12 +2,6 @@
|
|
2
2
|
|
3
3
|
exports.__esModule = true;
|
4
4
|
|
5
|
-
var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
|
6
|
-
|
7
|
-
var _warnOnce = require('./warn-once');
|
8
|
-
|
9
|
-
var _warnOnce2 = _interopRequireDefault(_warnOnce);
|
10
|
-
|
11
5
|
var _node = require('./node');
|
12
6
|
|
13
7
|
var _node2 = _interopRequireDefault(_node);
|
@@ -29,61 +23,39 @@ function _inherits(subClass, superClass) { if (typeof superClass !== "function"
|
|
29
23
|
* @extends Node
|
30
24
|
*/
|
31
25
|
var Comment = function (_Node) {
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
/**
|
65
|
-
* @memberof Comment#
|
66
|
-
* @member {string} text - the comment’s text
|
67
|
-
*/
|
68
|
-
|
69
|
-
/**
|
70
|
-
* @memberof Comment#
|
71
|
-
* @member {object} raws - Information to generate byte-to-byte equal
|
72
|
-
* node string as it was in the origin input.
|
73
|
-
*
|
74
|
-
* Every parser saves its own properties,
|
75
|
-
* but the default CSS parser uses:
|
76
|
-
*
|
77
|
-
* * `before`: the space symbols before the node.
|
78
|
-
* * `left`: the space symbols between `/*` and the comment’s text.
|
79
|
-
* * `right`: the space symbols between the comment’s text.
|
80
|
-
*/
|
81
|
-
|
82
|
-
}]);
|
83
|
-
|
84
|
-
return Comment;
|
26
|
+
_inherits(Comment, _Node);
|
27
|
+
|
28
|
+
function Comment(defaults) {
|
29
|
+
_classCallCheck(this, Comment);
|
30
|
+
|
31
|
+
var _this = _possibleConstructorReturn(this, _Node.call(this, defaults));
|
32
|
+
|
33
|
+
_this.type = 'comment';
|
34
|
+
return _this;
|
35
|
+
}
|
36
|
+
|
37
|
+
/**
|
38
|
+
* @memberof Comment#
|
39
|
+
* @member {string} text - the comment’s text
|
40
|
+
*/
|
41
|
+
|
42
|
+
/**
|
43
|
+
* @memberof Comment#
|
44
|
+
* @member {object} raws - Information to generate byte-to-byte equal
|
45
|
+
* node string as it was in the origin input.
|
46
|
+
*
|
47
|
+
* Every parser saves its own properties,
|
48
|
+
* but the default CSS parser uses:
|
49
|
+
*
|
50
|
+
* * `before`: the space symbols before the node.
|
51
|
+
* * `left`: the space symbols between `/*` and the comment’s text.
|
52
|
+
* * `right`: the space symbols between the comment’s text.
|
53
|
+
*/
|
54
|
+
|
55
|
+
|
56
|
+
return Comment;
|
85
57
|
}(_node2.default);
|
86
58
|
|
87
59
|
exports.default = Comment;
|
88
60
|
module.exports = exports['default'];
|
89
|
-
//# sourceMappingURL=data:application/json;charset=utf8;base64,
|
61
|
+
//# sourceMappingURL=data:application/json;charset=utf8;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