Skip to content

Commit badea71

Browse files
author
Bart Veneman
committed
add gradients
1 parent 6db7891 commit badea71

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/index.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,7 @@ function analyze(css, options = {}) {
148148
let colors = new ContextCollection({ useLocations })
149149
let colorFormats = new Collection({ useLocations })
150150
let units = new ContextCollection({ useLocations })
151+
let gradients = new Collection({ useLocations })
151152

152153
walk(ast, function (node) {
153154
switch (node.type) {
@@ -482,12 +483,12 @@ function analyze(css, options = {}) {
482483

483484
if (colorFunctions.has(nodeName)) {
484485
colors.push(stringifyNode(valueNode), property, valueNode.loc)
485-
colorFormats.push(nodeName.toLowerCase())
486+
colorFormats.push(nodeName.toLowerCase(), valueNode.loc)
486487
return
487488
}
488489

489490
if (endsWith('gradient', nodeName)) {
490-
gradients.push(stringifyNode(valueNode))
491+
gradients.push(stringifyNode(valueNode), valueNode.loc)
491492
return
492493
}
493494
// No this.skip here intentionally,

0 commit comments

Comments
 (0)