Skip to content

Commit

Permalink
skip syntax matching for custom properties (fixes #31)
Browse files Browse the repository at this point in the history
  • Loading branch information
lahmatiy committed Jan 19, 2017
1 parent bde465c commit 91a13b8
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
9 changes: 9 additions & 0 deletions lib/syntax/syntax.js
Expand Up @@ -161,6 +161,15 @@ Syntax.prototype = {
},
matchProperty: function(propertyName, value) {
var property = names.property(propertyName);

// don't match syntax for a custom property
if (propertyName[0] === '-' && propertyName[1] === '-') {
return {
type: 'NoMatch',
comment: 'Syntax matching doesn\'t applicable for custom properties'
};
}

var propertySyntax = property.vendor
? this.getProperty(property.vendor + property.name) || this.getProperty(property.name)
: this.getProperty(property.name);
Expand Down
6 changes: 6 additions & 0 deletions test/fixture/syntax/var.json
Expand Up @@ -15,5 +15,11 @@
"VAR(--name)",
"VAR(--name) qux"
]
},
"custom properties should be ignored": {
"property": "--var",
"valid": [
"any value"
]
}
}

0 comments on commit 91a13b8

Please sign in to comment.