Skip to content

Commit ab54dbd

Browse files
committed
fix: color fn names should be case-insensitive. fixes shellscape#68
1 parent edb599a commit ab54dbd

File tree

4 files changed

+359
-33
lines changed

4 files changed

+359
-33
lines changed

lib/nodes/Func.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ class Func extends Container {
9696
parser.back(rightTokens);
9797

9898
const { lastNode } = parser;
99-
lastNode.isColor = colorFunctions.includes(lastNode.name);
99+
lastNode.isColor = colorFunctions.includes(lastNode.name.toLowerCase());
100100
}
101101
}
102102

test/fixtures/func.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@ module.exports = {
2323
'url(http://123.example.com)',
2424
'url(//123.example.com)',
2525
'rgba( 29, 439 , 29 )',
26+
'RGBA( 29, 439 , 29 )',
27+
'RgBa( 29, 439 , 29 )',
2628
'calc(-0.5 * var(foo))',
2729
'calc(1px + -2vw - 4px)',
2830
'calc(((768px - 100vw) / 2) - 15px)',

0 commit comments

Comments
 (0)