postcss 8.3.9 → 8.4.31
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.
- package/README.md +7 -23
- package/lib/at-rule.d.ts +58 -49
- package/lib/comment.d.ts +43 -32
- package/lib/container.d.ts +233 -223
- package/lib/container.js +251 -244
- package/lib/css-syntax-error.d.ts +117 -61
- package/lib/css-syntax-error.js +10 -3
- package/lib/declaration.d.ts +85 -61
- package/lib/document.d.ts +27 -16
- package/lib/fromJSON.d.ts +6 -2
- package/lib/input.d.ts +118 -54
- package/lib/input.js +87 -55
- package/lib/lazy-result.d.ts +82 -67
- package/lib/lazy-result.js +234 -232
- package/lib/list.d.ts +53 -47
- package/lib/list.js +16 -14
- package/lib/map-generator.js +231 -172
- package/lib/no-work-result.d.ts +46 -0
- package/lib/no-work-result.js +135 -0
- package/lib/node.d.ts +345 -253
- package/lib/node.js +200 -139
- package/lib/parse.d.ts +6 -2
- package/lib/parser.js +354 -309
- package/lib/postcss.d.mts +72 -0
- package/lib/postcss.d.ts +288 -319
- package/lib/postcss.js +18 -12
- package/lib/postcss.mjs +1 -0
- package/lib/previous-map.d.ts +23 -14
- package/lib/previous-map.js +37 -40
- package/lib/processor.d.ts +55 -41
- package/lib/processor.js +20 -27
- package/lib/result.d.ts +87 -76
- package/lib/root.d.ts +49 -36
- package/lib/root.js +12 -10
- package/lib/rule.d.ts +54 -45
- package/lib/stringifier.d.ts +46 -0
- package/lib/stringifier.js +140 -138
- package/lib/stringify.d.ts +6 -2
- package/lib/terminal-highlight.js +11 -11
- package/lib/tokenize.js +2 -2
- package/lib/warn-once.js +1 -0
- package/lib/warning.d.ts +79 -36
- package/lib/warning.js +6 -4
- package/package.json +20 -10
package/README.md
CHANGED
@@ -1,44 +1,28 @@
|
|
1
|
-
# PostCSS
|
1
|
+
# PostCSS
|
2
2
|
|
3
3
|
<img align="right" width="95" height="95"
|
4
4
|
alt="Philosopher’s stone, logo of PostCSS"
|
5
5
|
src="https://postcss.org/logo.svg">
|
6
6
|
|
7
|
-
[chat-img]: https://img.shields.io/badge/Gitter-Join_the_PostCSS_chat-brightgreen.svg
|
8
|
-
[chat]: https://gitter.im/postcss/postcss
|
9
|
-
|
10
7
|
PostCSS is a tool for transforming styles with JS plugins.
|
11
8
|
These plugins can lint your CSS, support variables and mixins,
|
12
9
|
transpile future CSS syntax, inline images, and more.
|
13
10
|
|
14
11
|
PostCSS is used by industry leaders including Wikipedia, Twitter, Alibaba,
|
15
|
-
and JetBrains. The [Autoprefixer] PostCSS
|
16
|
-
CSS processors.
|
12
|
+
and JetBrains. The [Autoprefixer] and [Stylelint] PostCSS plugins is one of the most popular CSS tools.
|
17
13
|
|
18
|
-
|
19
|
-
(by transforming them into an [Abstract Syntax Tree]).
|
20
|
-
This API can then be used by [plugins] to do a lot of useful things,
|
21
|
-
e.g., to find errors automatically, or to insert vendor prefixes.
|
14
|
+
---
|
22
15
|
|
23
|
-
|
24
|
-
**Twitter account:** [@postcss](https://twitter.com/postcss)<br>
|
25
|
-
**VK.com page:** [postcss](https://vk.com/postcss)<br>
|
26
|
-
**中文翻译**: [`docs/README-cn.md`](./docs/README-cn.md)
|
16
|
+
<img src="https://cdn.evilmartians.com/badges/logo-no-label.svg" alt="" width="22" height="16" /> Made in <b><a href="https://evilmartians.com/?utm_source=postcss&utm_campaign=devtools-button&utm_medium=github">Evil Martians</a></b>, product consulting for <b>developer tools</b>.
|
27
17
|
|
28
|
-
|
29
|
-
of your company, PostCSS plugins), contact [Evil Martians]
|
30
|
-
at <postcss@evilmartians.com>.
|
18
|
+
---
|
31
19
|
|
32
20
|
[Abstract Syntax Tree]: https://en.wikipedia.org/wiki/Abstract_syntax_tree
|
33
21
|
[Evil Martians]: https://evilmartians.com/?utm_source=postcss
|
34
22
|
[Autoprefixer]: https://github.com/postcss/autoprefixer
|
23
|
+
[Stylelint]: https://stylelint.io/
|
35
24
|
[plugins]: https://github.com/postcss/postcss#plugins
|
36
25
|
|
37
|
-
<a href="https://evilmartians.com/?utm_source=postcss">
|
38
|
-
<img src="https://evilmartians.com/badges/sponsored-by-evil-martians.svg"
|
39
|
-
alt="Sponsored by Evil Martians" width="236" height="54">
|
40
|
-
</a>
|
41
|
-
|
42
26
|
|
43
27
|
## Docs
|
44
|
-
Read
|
28
|
+
Read full docs **[here](https://postcss.org/)**.
|
package/lib/at-rule.d.ts
CHANGED
@@ -1,48 +1,53 @@
|
|
1
1
|
import Container, { ContainerProps } from './container.js'
|
2
2
|
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
3
|
+
declare namespace AtRule {
|
4
|
+
export interface AtRuleRaws extends Record<string, unknown> {
|
5
|
+
/**
|
6
|
+
* The space symbols after the last child of the node to the end of the node.
|
7
|
+
*/
|
8
|
+
after?: string
|
9
9
|
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
10
|
+
/**
|
11
|
+
* The space between the at-rule name and its parameters.
|
12
|
+
*/
|
13
|
+
afterName?: string
|
14
14
|
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
15
|
+
/**
|
16
|
+
* The space symbols before the node. It also stores `*`
|
17
|
+
* and `_` symbols before the declaration (IE hack).
|
18
|
+
*/
|
19
|
+
before?: string
|
19
20
|
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
21
|
+
/**
|
22
|
+
* The symbols between the last parameter and `{` for rules.
|
23
|
+
*/
|
24
|
+
between?: string
|
24
25
|
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
26
|
+
/**
|
27
|
+
* The rule’s selector with comments.
|
28
|
+
*/
|
29
|
+
params?: {
|
30
|
+
raw: string
|
31
|
+
value: string
|
32
|
+
}
|
29
33
|
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
value: string
|
35
|
-
raw: string
|
34
|
+
/**
|
35
|
+
* Contains `true` if the last child has an (optional) semicolon.
|
36
|
+
*/
|
37
|
+
semicolon?: boolean
|
36
38
|
}
|
37
|
-
}
|
38
39
|
|
39
|
-
export interface AtRuleProps extends ContainerProps {
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
40
|
+
export interface AtRuleProps extends ContainerProps {
|
41
|
+
/** Name of the at-rule. */
|
42
|
+
name: string
|
43
|
+
/** Parameters following the name of the at-rule. */
|
44
|
+
params?: number | string
|
45
|
+
/** Information used to generate byte-to-byte equal node string as it was in the origin input. */
|
46
|
+
raws?: AtRuleRaws
|
47
|
+
}
|
48
|
+
|
49
|
+
// eslint-disable-next-line @typescript-eslint/no-use-before-define
|
50
|
+
export { AtRule_ as default }
|
46
51
|
}
|
47
52
|
|
48
53
|
/**
|
@@ -56,7 +61,7 @@ export interface AtRuleProps extends ContainerProps {
|
|
56
61
|
* }
|
57
62
|
* ```
|
58
63
|
*
|
59
|
-
* If it’s followed in the CSS by a {} block, this node will have
|
64
|
+
* If it’s followed in the CSS by a `{}` block, this node will have
|
60
65
|
* a nodes property representing its children.
|
61
66
|
*
|
62
67
|
* ```js
|
@@ -70,11 +75,7 @@ export interface AtRuleProps extends ContainerProps {
|
|
70
75
|
* media.nodes //=> []
|
71
76
|
* ```
|
72
77
|
*/
|
73
|
-
|
74
|
-
type: 'atrule'
|
75
|
-
parent: Container | undefined
|
76
|
-
raws: AtRuleRaws
|
77
|
-
|
78
|
+
declare class AtRule_ extends Container {
|
78
79
|
/**
|
79
80
|
* The at-rule’s name immediately follows the `@`.
|
80
81
|
*
|
@@ -85,10 +86,9 @@ export default class AtRule extends Container {
|
|
85
86
|
* ```
|
86
87
|
*/
|
87
88
|
name: string
|
88
|
-
|
89
89
|
/**
|
90
90
|
* The at-rule’s parameters, the values that follow the at-rule’s name
|
91
|
-
* but precede any {} block.
|
91
|
+
* but precede any `{}` block.
|
92
92
|
*
|
93
93
|
* ```js
|
94
94
|
* const root = postcss.parse('@media print, screen {}')
|
@@ -97,10 +97,19 @@ export default class AtRule extends Container {
|
|
97
97
|
* ```
|
98
98
|
*/
|
99
99
|
params: string
|
100
|
+
parent: Container | undefined
|
101
|
+
|
102
|
+
raws: AtRule.AtRuleRaws
|
103
|
+
|
104
|
+
type: 'atrule'
|
100
105
|
|
101
|
-
constructor(defaults?: AtRuleProps)
|
102
|
-
assign(overrides:
|
103
|
-
clone(overrides?: Partial<AtRuleProps>):
|
104
|
-
|
105
|
-
|
106
|
+
constructor(defaults?: AtRule.AtRuleProps)
|
107
|
+
assign(overrides: AtRule.AtRuleProps | object): this
|
108
|
+
clone(overrides?: Partial<AtRule.AtRuleProps>): AtRule
|
109
|
+
cloneAfter(overrides?: Partial<AtRule.AtRuleProps>): AtRule
|
110
|
+
cloneBefore(overrides?: Partial<AtRule.AtRuleProps>): AtRule
|
106
111
|
}
|
112
|
+
|
113
|
+
declare class AtRule extends AtRule_ {}
|
114
|
+
|
115
|
+
export = AtRule
|
package/lib/comment.d.ts
CHANGED
@@ -1,56 +1,67 @@
|
|
1
1
|
import Container from './container.js'
|
2
2
|
import Node, { NodeProps } from './node.js'
|
3
3
|
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
4
|
+
declare namespace Comment {
|
5
|
+
export interface CommentRaws extends Record<string, unknown> {
|
6
|
+
/**
|
7
|
+
* The space symbols before the node.
|
8
|
+
*/
|
9
|
+
before?: string
|
9
10
|
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
11
|
+
/**
|
12
|
+
* The space symbols between `/*` and the comment’s text.
|
13
|
+
*/
|
14
|
+
left?: string
|
14
15
|
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
}
|
16
|
+
/**
|
17
|
+
* The space symbols between the comment’s text.
|
18
|
+
*/
|
19
|
+
right?: string
|
20
|
+
}
|
20
21
|
|
21
|
-
export interface CommentProps extends NodeProps {
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
22
|
+
export interface CommentProps extends NodeProps {
|
23
|
+
/** Information used to generate byte-to-byte equal node string as it was in the origin input. */
|
24
|
+
raws?: CommentRaws
|
25
|
+
/** Content of the comment. */
|
26
|
+
text: string
|
27
|
+
}
|
28
|
+
|
29
|
+
// eslint-disable-next-line @typescript-eslint/no-use-before-define
|
30
|
+
export { Comment_ as default }
|
26
31
|
}
|
27
32
|
|
28
33
|
/**
|
29
|
-
*
|
34
|
+
* It represents a class that handles
|
35
|
+
* [CSS comments](https://developer.mozilla.org/en-US/docs/Web/CSS/Comments)
|
30
36
|
*
|
31
37
|
* ```js
|
32
38
|
* Once (root, { Comment }) {
|
33
|
-
*
|
39
|
+
* const note = new Comment({ text: 'Note: …' })
|
34
40
|
* root.append(note)
|
35
41
|
* }
|
36
42
|
* ```
|
37
43
|
*
|
38
|
-
*
|
39
|
-
* will be stored in the `raws` properties
|
44
|
+
* Remember that CSS comments inside selectors, at-rule parameters,
|
45
|
+
* or declaration values will be stored in the `raws` properties
|
46
|
+
* explained above.
|
40
47
|
*/
|
41
|
-
|
42
|
-
type: 'comment'
|
48
|
+
declare class Comment_ extends Node {
|
43
49
|
parent: Container | undefined
|
44
|
-
raws: CommentRaws
|
45
|
-
|
50
|
+
raws: Comment.CommentRaws
|
46
51
|
/**
|
47
52
|
* The comment's text.
|
48
53
|
*/
|
49
54
|
text: string
|
50
55
|
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
+
type: 'comment'
|
57
|
+
|
58
|
+
constructor(defaults?: Comment.CommentProps)
|
59
|
+
assign(overrides: Comment.CommentProps | object): this
|
60
|
+
clone(overrides?: Partial<Comment.CommentProps>): Comment
|
61
|
+
cloneAfter(overrides?: Partial<Comment.CommentProps>): Comment
|
62
|
+
cloneBefore(overrides?: Partial<Comment.CommentProps>): Comment
|
56
63
|
}
|
64
|
+
|
65
|
+
declare class Comment extends Comment_ {}
|
66
|
+
|
67
|
+
export = Comment
|