Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Check for custom properties in no-color-keywords #1124

Merged
merged 2 commits into from
Aug 30, 2017
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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';
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should probably use .is method

}

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);