postcss 8.5.12 → 8.5.14
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/lazy-result.js +4 -1
- package/lib/processor.js +1 -1
- package/lib/stringifier.js +8 -28
- package/package.json +1 -1
package/lib/lazy-result.js
CHANGED
|
@@ -379,7 +379,10 @@ class LazyResult {
|
|
|
379
379
|
if (str.stringify) str = str.stringify
|
|
380
380
|
|
|
381
381
|
let rootSource = this.result.root.source
|
|
382
|
-
if (
|
|
382
|
+
if (
|
|
383
|
+
opts.map === undefined &&
|
|
384
|
+
!(rootSource && rootSource.input && rootSource.input.map)
|
|
385
|
+
) {
|
|
383
386
|
let result = ''
|
|
384
387
|
str(this.result.root, i => {
|
|
385
388
|
result += i
|
package/lib/processor.js
CHANGED
package/lib/stringifier.js
CHANGED
|
@@ -85,22 +85,15 @@ class Stringifier {
|
|
|
85
85
|
}
|
|
86
86
|
|
|
87
87
|
block(node, start) {
|
|
88
|
-
let
|
|
89
|
-
let between = typeof raws.between !== 'undefined'
|
|
90
|
-
? raws.between
|
|
91
|
-
: this.raw(node, 'between', 'beforeOpen')
|
|
88
|
+
let between = this.raw(node, 'between', 'beforeOpen')
|
|
92
89
|
this.builder(escapeHTMLInCSS(start + between) + '{', node, 'start')
|
|
93
90
|
|
|
94
91
|
let after
|
|
95
92
|
if (node.nodes && node.nodes.length) {
|
|
96
93
|
this.body(node)
|
|
97
|
-
after =
|
|
98
|
-
? raws.after
|
|
99
|
-
: this.raw(node, 'after')
|
|
94
|
+
after = this.raw(node, 'after')
|
|
100
95
|
} else {
|
|
101
|
-
after =
|
|
102
|
-
? raws.after
|
|
103
|
-
: this.raw(node, 'after', 'emptyBody')
|
|
96
|
+
after = this.raw(node, 'after', 'emptyBody')
|
|
104
97
|
}
|
|
105
98
|
|
|
106
99
|
if (after) this.builder(escapeHTMLInCSS(after))
|
|
@@ -119,36 +112,23 @@ class Stringifier {
|
|
|
119
112
|
let isDocument = node.type === 'document'
|
|
120
113
|
for (let i = 0; i < nodes.length; i++) {
|
|
121
114
|
let child = nodes[i]
|
|
122
|
-
let before = child
|
|
123
|
-
if (typeof before === 'undefined') {
|
|
124
|
-
before = this.raw(child, 'before')
|
|
125
|
-
}
|
|
115
|
+
let before = this.raw(child, 'before')
|
|
126
116
|
if (before) this.builder(isDocument ? before : escapeHTMLInCSS(before))
|
|
127
117
|
this.stringify(child, last !== i || semicolon)
|
|
128
118
|
}
|
|
129
119
|
}
|
|
130
120
|
|
|
131
121
|
comment(node) {
|
|
132
|
-
let
|
|
133
|
-
let
|
|
134
|
-
? raws.left
|
|
135
|
-
: this.raw(node, 'left', 'commentLeft')
|
|
136
|
-
let right = typeof raws.right !== 'undefined'
|
|
137
|
-
? raws.right
|
|
138
|
-
: this.raw(node, 'right', 'commentRight')
|
|
122
|
+
let left = this.raw(node, 'left', 'commentLeft')
|
|
123
|
+
let right = this.raw(node, 'right', 'commentRight')
|
|
139
124
|
this.builder(escapeHTMLInCSS('/*' + left + node.text + right + '*/'), node)
|
|
140
125
|
}
|
|
141
126
|
|
|
142
127
|
decl(node, semicolon) {
|
|
143
128
|
let raws = node.raws
|
|
144
|
-
let between =
|
|
145
|
-
? raws.between
|
|
146
|
-
: this.raw(node, 'between', 'colon')
|
|
147
|
-
|
|
148
|
-
let rawVal = raws.value
|
|
149
|
-
let value = rawVal && rawVal.value === node.value ? rawVal.raw : node.value
|
|
129
|
+
let between = this.raw(node, 'between', 'colon')
|
|
150
130
|
|
|
151
|
-
let string = node.prop + between + value
|
|
131
|
+
let string = node.prop + between + this.rawValue(node, 'value')
|
|
152
132
|
|
|
153
133
|
if (node.important) {
|
|
154
134
|
string += raws.important || ' !important'
|