Skip to content

Commit

Permalink
Check for custom properties in no-color-keywords
Browse files Browse the repository at this point in the history
  • Loading branch information
DanPurdy committed Aug 30, 2017
1 parent cca399c commit e31abb6
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion lib/rules/no-color-keywords.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ var cssColors = yaml.safeLoad(fs.readFileSync(path.join(__dirname, '../../data',
*/
var checkValidParentType = function (node) {
if (node) {
return node.type === 'function' || node.type === 'variable';
return node.type === 'function' || node.type === 'variable' || node.type === 'customProperty';
}

return false;
Expand Down
2 changes: 2 additions & 0 deletions tests/sass/no-color-keywords.sass
Original file line number Diff line number Diff line change
Expand Up @@ -31,3 +31,5 @@ $other: rgba($blue, 0.3)

// Issue #717 - rule trips over Sass color function names
$colors: ( 'red': red($color), 'green': green($color), 'blue': blue($color) )

$badge-bg: var(--red)
2 changes: 2 additions & 0 deletions tests/sass/no-color-keywords.scss
Original file line number Diff line number Diff line change
Expand Up @@ -42,3 +42,5 @@ $colors: (
'green': green($color),
'blue': blue($color)
);

$badge-bg: var(--red);

0 comments on commit e31abb6

Please sign in to comment.