1
1
'use strict' ;
2
2
3
- const path = require ( 'path' ) ;
4
- const postcss = require ( 'postcss' ) ;
5
- const diff = require ( 'diff' ) ;
6
- const chalk = require ( 'chalk ' ) ;
7
- const maxmin = require ( 'maxmin' ) ;
3
+ const path = require ( 'path' ) ;
4
+ const postcss = require ( 'postcss' ) ;
5
+ const diff = require ( 'diff' ) ;
6
+ const { cyan } = require ( 'kleur ' ) ;
7
+ const maxmin = require ( 'maxmin' ) ;
8
8
9
9
module . exports = function ( grunt ) {
10
10
let options ;
@@ -164,7 +164,7 @@ module.exports = function(grunt) {
164
164
this . files . forEach ( function ( f ) {
165
165
let src = f . src . filter ( function ( filepath ) {
166
166
if ( ! grunt . file . exists ( filepath ) ) {
167
- grunt . log . warn ( `Source file ${ chalk . cyan ( filepath ) } not found.` ) ;
167
+ grunt . log . warn ( `Source file ${ cyan ( filepath ) } not found.` ) ;
168
168
169
169
return false ;
170
170
}
@@ -195,7 +195,7 @@ module.exports = function(grunt) {
195
195
if ( options . writeDest ) {
196
196
tally . sizeAfter += result . css . length ;
197
197
grunt . file . write ( dest , result . css ) ;
198
- log ( `File ${ chalk . cyan ( dest ) } created.${ chalk . dim ( maxmin ( input . length , result . css . length ) ) } ` ) ;
198
+ log ( `File ${ cyan ( dest ) } created.${ cyan ( maxmin ( input . length , result . css . length ) ) } ` ) ;
199
199
}
200
200
201
201
tally . sheets += 1 ;
@@ -208,7 +208,7 @@ module.exports = function(grunt) {
208
208
}
209
209
210
210
grunt . file . write ( mapDest , result . map . toString ( ) ) ;
211
- log ( `File ${ chalk . cyan ( `${ dest } .map` ) } created (source map).` ) ;
211
+ log ( `File ${ cyan ( `${ dest } .map` ) } created (source map).` ) ;
212
212
213
213
tally . maps += 1 ;
214
214
}
@@ -217,7 +217,7 @@ module.exports = function(grunt) {
217
217
const diffPath = ( typeof options . diff === 'string' ) ? options . diff : `${ dest } .diff` ;
218
218
219
219
grunt . file . write ( diffPath , diff . createPatch ( dest , input , result . css ) ) ;
220
- log ( `File ${ chalk . cyan ( diffPath ) } created (diff).` ) ;
220
+ log ( `File ${ cyan ( diffPath ) } created (diff).` ) ;
221
221
222
222
tally . diffs += 1 ;
223
223
}
@@ -228,7 +228,7 @@ module.exports = function(grunt) {
228
228
runTasks ( ) . then ( function ( ) {
229
229
if ( tally . sheets ) {
230
230
if ( options . writeDest ) {
231
- const size = chalk . dim ( maxmin ( tally . sizeBefore , tally . sizeAfter ) ) ;
231
+ const size = cyan ( maxmin ( tally . sizeBefore , tally . sizeAfter ) ) ;
232
232
grunt . log . ok ( `${ tally . sheets } processed ${ grunt . util . pluralize ( tally . sheets , 'stylesheet/stylesheets' ) } created. ${ size } ` ) ;
233
233
} else {
234
234
grunt . log . ok ( `${ tally . sheets } ${ grunt . util . pluralize ( tally . sheets , 'stylesheet/stylesheets' ) } processed, no files written.` ) ;
0 commit comments