Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
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
1 change: 1 addition & 0 deletions Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ module.exports = function (grunt) {
palettable: {
options: {
outputFilePath: 'tmp/sanity-check.html',
excludedFiles: '**/kss.scss',
stylesDirectory: 'test/fixtures/sanity-check',
templateLayoutPath: 'test/templates/layout.html',
templateSwatchPath: 'test/templates/swatch.html'
Expand Down
10 changes: 9 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,8 @@ In your project's Gruntfile, add a section named `palettable` to the data object
grunt.initConfig({
palettable: {
options: {
stylesDirectory: 'app/css/'
stylesDirectory: 'app/css/',
excludedFiles: '**/kss.scss'
// Optional configuration options go here
}
}
Expand Down Expand Up @@ -84,6 +85,12 @@ Default `.`

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

#### excludedFiles
Type: `String`;
Default `null`

Here you can specify the file(s) you want to exclude from the process. Grunt will ignore those files.

#### outputFilePath
Type: `String`;
Default `color-palette.html`
Expand Down Expand Up @@ -196,6 +203,7 @@ In lieu of a formal styleguide, take care to maintain the existing coding style.

## Release History

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

## License
Expand Down
2 changes: 1 addition & 1 deletion bower.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "palettable",
"version": "1.0.1",
"version": "1.1.0",
"description": "Generate HTML color palettes from either SASS, SCSS, or Stylus stylesheets.",
"repository": "https://github.com/bvaughn/palettable",
"author": {
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "palettable",
"version": "1.0.1",
"version": "1.1.0",
"description": "Generate HTML color palettes from either SASS, SCSS, or Stylus stylesheets.",
"repository": "https://github.com/bvaughn/palettable",
"author": {
Expand Down
43 changes: 22 additions & 21 deletions tasks/palettable.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ module.exports = function(grunt) {
openInBrowser: false,
outputFilePath: 'color-palette.html',
stylesDirectory: '.',
excludedFiles: '/',
templateLayoutPath: __dirname + '/../templates/layout.html',
templateSwatchPath: __dirname + '/../templates/swatch.html',
hoverColorFunction: palettable.defaultHoverColorFunction,
Expand All @@ -42,31 +43,31 @@ module.exports = function(grunt) {
var colors = [];

// Gather all $colors in our SCSS files
grunt.file.expand({cwd: options.stylesDirectory}, '**/*.scss').
forEach(function(file) {
palettable.parseSCSS(
grunt.file.read(options.stylesDirectory + '/' + file),
file,
colors);
});
grunt.file.expand({cwd: options.stylesDirectory}, '**/*.scss', '!' + options.excludedFiles).
forEach(function(file) {
palettable.parseSCSS(
grunt.file.read(options.stylesDirectory + '/' + file),
file,
colors);
});

// Gather all $colors in our SCSS files
grunt.file.expand({cwd: options.stylesDirectory}, '**/*.sass').
forEach(function(file) {
palettable.parseSASS(
grunt.file.read(options.stylesDirectory + '/' + file),
file,
colors);
});
grunt.file.expand({cwd: options.stylesDirectory}, '**/*.sass', '!' + options.excludedFiles).
forEach(function(file) {
palettable.parseSASS(
grunt.file.read(options.stylesDirectory + '/' + file),
file,
colors);
});

// Gather all $colors in our SCSS files
grunt.file.expand({cwd: options.stylesDirectory}, '**/*.styl').
forEach(function(file) {
palettable.parseStylus(
grunt.file.read(options.stylesDirectory + '/' + file),
file,
colors);
});
grunt.file.expand({cwd: options.stylesDirectory}, '**/*.styl', '!' + options.excludedFiles).
forEach(function(file) {
palettable.parseStylus(
grunt.file.read(options.stylesDirectory + '/' + file),
file,
colors);
});

// Sort by hue
colors = palettable.sortColors(colors, options.colorSortFunction);
Expand Down
4 changes: 4 additions & 0 deletions test/fixtures/sanity-check/kss.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
$scss-color-to-ignore-1: #00BBBB;
$scss-color-to-ignore-2: #316635;
$scss-color-to-ignore-3: rgb(64, 63, 153);
$scss-color-to-ignore-4: rgb(170, 163, 18);