postcss 8.5.20 → 8.5.22

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/lib/node.d.ts CHANGED
@@ -31,12 +31,12 @@ declare namespace Node {
31
31
 
32
32
  export interface Position {
33
33
  /**
34
- * Source line in file. In contrast to `offset` it starts from 1.
34
+ * Source column in file. It starts from 1.
35
35
  */
36
36
  column: number
37
37
 
38
38
  /**
39
- * Source column in file.
39
+ * Source line in file. It starts from 1.
40
40
  */
41
41
  line: number
42
42
 
package/lib/processor.js CHANGED
@@ -7,7 +7,7 @@ let Root = require('./root')
7
7
 
8
8
  class Processor {
9
9
  constructor(plugins = []) {
10
- this.version = '8.5.20'
10
+ this.version = '8.5.22'
11
11
  this.plugins = this.normalize(plugins)
12
12
  }
13
13
 
@@ -60,10 +60,24 @@ function pushBody(str, stack, node) {
60
60
  let semicolon = str.raw(node, 'semicolon')
61
61
  let isDocument = node.type === 'document'
62
62
  for (let i = nodes.length - 1; i >= 0; i--) {
63
+ let child = nodes[i]
64
+ let childSemicolon = last !== i || semicolon
65
+ // A childless at-rule or a custom property declaration that still has
66
+ // following siblings must be terminated. Without the semicolon those
67
+ // trailing comments are folded into the at-rule's prelude or the custom
68
+ // property's value and disappear when the output is re-parsed.
69
+ if (
70
+ !childSemicolon &&
71
+ i < nodes.length - 1 &&
72
+ ((child.type === 'atrule' && !child.nodes) ||
73
+ (child.type === 'decl' && child.prop.startsWith('--')))
74
+ ) {
75
+ childSemicolon = true
76
+ }
63
77
  stack.push({
64
78
  document: isDocument,
65
- node: nodes[i],
66
- semicolon: last !== i || semicolon
79
+ node: child,
80
+ semicolon: childSemicolon
67
81
  })
68
82
  }
69
83
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "postcss",
3
- "version": "8.5.20",
3
+ "version": "8.5.22",
4
4
  "description": "Tool for transforming styles with JS plugins",
5
5
  "keywords": [
6
6
  "css",