-
Notifications
You must be signed in to change notification settings - Fork 529
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #829 from sasstools/release/1.9.0
Release/1.9.0
- Loading branch information
Showing
22 changed files
with
615 additions
and
148 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
# No Color Hex | ||
|
||
Rule `no-color-hex` will disallow the use of hexadecimal colors | ||
|
||
## Examples | ||
|
||
When enabled the following are disallowed. | ||
|
||
```scss | ||
$foo-color: #456; | ||
|
||
.bar { | ||
background: linear-gradient(top, #3ff, #ddd); | ||
} | ||
|
||
.baz { | ||
color: #fff; | ||
} | ||
``` | ||
|
||
When enabled the following are allowed: | ||
|
||
```scss | ||
$foo-color: red; | ||
|
||
.bar { | ||
background: linear-gradient(top, blue, green); | ||
} | ||
|
||
.baz { | ||
color: white; | ||
} | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
'use strict'; | ||
|
||
var helpers = require('../helpers'); | ||
|
||
module.exports = { | ||
'name': 'no-color-hex', | ||
'defaults': {}, | ||
'detect': function (ast, parser) { | ||
var result = []; | ||
|
||
ast.traverseByType('color', function (value) { | ||
result = helpers.addUnique(result, { | ||
'ruleId': parser.rule.name, | ||
'line': value.start.line, | ||
'column': value.start.column, | ||
'message': 'Hexadecimal colors should not be used', | ||
'severity': parser.severity | ||
}); | ||
}); | ||
return result; | ||
} | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.