Skip to content

Commit e31abb6

Browse files
committed
Check for custom properties in no-color-keywords
1 parent cca399c commit e31abb6

File tree

3 files changed

+5
-1
lines changed

3 files changed

+5
-1
lines changed

lib/rules/no-color-keywords.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ var cssColors = yaml.safeLoad(fs.readFileSync(path.join(__dirname, '../../data',
1616
*/
1717
var checkValidParentType = function (node) {
1818
if (node) {
19-
return node.type === 'function' || node.type === 'variable';
19+
return node.type === 'function' || node.type === 'variable' || node.type === 'customProperty';
2020
}
2121

2222
return false;

tests/sass/no-color-keywords.sass

+2
Original file line numberDiff line numberDiff line change
@@ -31,3 +31,5 @@ $other: rgba($blue, 0.3)
3131

3232
// Issue #717 - rule trips over Sass color function names
3333
$colors: ( 'red': red($color), 'green': green($color), 'blue': blue($color) )
34+
35+
$badge-bg: var(--red)

tests/sass/no-color-keywords.scss

+2
Original file line numberDiff line numberDiff line change
@@ -42,3 +42,5 @@ $colors: (
4242
'green': green($color),
4343
'blue': blue($color)
4444
);
45+
46+
$badge-bg: var(--red);

0 commit comments

Comments
 (0)