Skip to content

Commit 75bb388

Browse files
FBiocchettiFBiocchetti
authored andcommitted
Added a parameter to exlude specific file(s)
1 parent b4030ba commit 75bb388

File tree

2 files changed

+31
-22
lines changed

2 files changed

+31
-22
lines changed

README.md

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,8 @@ In your project's Gruntfile, add a section named `palettable` to the data object
4949
grunt.initConfig({
5050
palettable: {
5151
options: {
52-
stylesDirectory: 'app/css/'
52+
stylesDirectory: 'app/css/',
53+
excludedFiles: '**/kss.scss'
5354
// Optional configuration options go here
5455
}
5556
}
@@ -84,6 +85,12 @@ Default `.`
8485

8586
This is the base directory for all of your SASS/SCSS files. Grunt will recurse this directory looking for color variables.
8687

88+
#### excludedFiles
89+
Type: `String`;
90+
Default `/`
91+
92+
Here you can specify the file(s) you want to exclude from the process. Grunt will ignore those files.
93+
8794
#### outputFilePath
8895
Type: `String`;
8996
Default `color-palette.html`
@@ -196,6 +203,7 @@ In lieu of a formal styleguide, take care to maintain the existing coding style.
196203

197204
## Release History
198205

206+
2017-05-02   v1.1.0   Added a parameter to exclude specific file(s).
199207
2014-07-14   v1.0.0   Initial release. Full SASS and Stylus support.
200208

201209
## License

tasks/palettable.js

Lines changed: 22 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ module.exports = function(grunt) {
2525
openInBrowser: false,
2626
outputFilePath: 'color-palette.html',
2727
stylesDirectory: '.',
28+
excludedFiles: '/',
2829
templateLayoutPath: __dirname + '/../templates/layout.html',
2930
templateSwatchPath: __dirname + '/../templates/swatch.html',
3031
hoverColorFunction: palettable.defaultHoverColorFunction,
@@ -42,31 +43,31 @@ module.exports = function(grunt) {
4243
var colors = [];
4344

4445
// Gather all $colors in our SCSS files
45-
grunt.file.expand({cwd: options.stylesDirectory}, '**/*.scss').
46-
forEach(function(file) {
47-
palettable.parseSCSS(
48-
grunt.file.read(options.stylesDirectory + '/' + file),
49-
file,
50-
colors);
51-
});
46+
grunt.file.expand({cwd: options.stylesDirectory}, '**/*.scss', '!' + options.excludedFiles).
47+
forEach(function(file) {
48+
palettable.parseSCSS(
49+
grunt.file.read(options.stylesDirectory + '/' + file),
50+
file,
51+
colors);
52+
});
5253

5354
// Gather all $colors in our SCSS files
54-
grunt.file.expand({cwd: options.stylesDirectory}, '**/*.sass').
55-
forEach(function(file) {
56-
palettable.parseSASS(
57-
grunt.file.read(options.stylesDirectory + '/' + file),
58-
file,
59-
colors);
60-
});
55+
grunt.file.expand({cwd: options.stylesDirectory}, '**/*.sass', '!' + options.excludedFiles).
56+
forEach(function(file) {
57+
palettable.parseSASS(
58+
grunt.file.read(options.stylesDirectory + '/' + file),
59+
file,
60+
colors);
61+
});
6162

6263
// Gather all $colors in our SCSS files
63-
grunt.file.expand({cwd: options.stylesDirectory}, '**/*.styl').
64-
forEach(function(file) {
65-
palettable.parseStylus(
66-
grunt.file.read(options.stylesDirectory + '/' + file),
67-
file,
68-
colors);
69-
});
64+
grunt.file.expand({cwd: options.stylesDirectory}, '**/*.styl', '!' + options.excludedFiles).
65+
forEach(function(file) {
66+
palettable.parseStylus(
67+
grunt.file.read(options.stylesDirectory + '/' + file),
68+
file,
69+
colors);
70+
});
7071

7172
// Sort by hue
7273
colors = palettable.sortColors(colors, options.colorSortFunction);

0 commit comments

Comments
 (0)