mirror of
https://github.com/kognise/water.css.git
synced 2025-12-06 06:44:58 +01:00
More silly style updates
This commit is contained in:
parent
45b1b26b7e
commit
d31f31680c
1 changed files with 11 additions and 11 deletions
22
gulpfile.js
22
gulpfile.js
|
|
@ -24,18 +24,18 @@ function humanFileSize(size) {
|
||||||
return ( size / Math.pow(1024, i) ).toFixed(2) * 1 + ' ' + ['B', 'kB', 'MB', 'GB', 'TB'][i];
|
return ( size / Math.pow(1024, i) ).toFixed(2) * 1 + ' ' + ['B', 'kB', 'MB', 'GB', 'TB'][i];
|
||||||
};
|
};
|
||||||
|
|
||||||
function formatByteMessage(source, data){
|
function formatByteMessage(source, data) {
|
||||||
var change = (data.savings > 0 ? 'saved' : 'gained');
|
const change = (data.savings > 0 ? 'saved' : 'gained')
|
||||||
var prettySavings = humanFileSize(Math.abs(data.savings));
|
const prettySavings = humanFileSize(Math.abs(data.savings))
|
||||||
var prettyStartSize = humanFileSize(data.startSize);
|
const prettyStartSize = humanFileSize(data.startSize)
|
||||||
var prettyEndSize = humanFileSize(data.endSize);
|
let prettyEndSize = humanFileSize(data.endSize)
|
||||||
|
|
||||||
if(data.endSize > data.startSize){
|
if (data.endSize > data.startSize) {
|
||||||
prettyEndSize = chalk.yellow(prettyEndSize);
|
prettyEndSize = chalk.yellow(prettyEndSize)
|
||||||
}
|
}
|
||||||
|
|
||||||
if(data.endSize < data.startSize){
|
if (data.endSize < data.startSize) {
|
||||||
prettyEndSize = chalk.green(prettyEndSize);
|
prettyEndSize = chalk.green(prettyEndSize)
|
||||||
}
|
}
|
||||||
|
|
||||||
return `${chalk.cyan(source.padStart(12, ' '))}: ${data.fileName} ${change} ${prettySavings} (${prettyStartSize} -> ${prettyEndSize})`
|
return `${chalk.cyan(source.padStart(12, ' '))}: ${data.fileName} ${change} ${prettySavings} (${prettyStartSize} -> ${prettyEndSize})`
|
||||||
|
|
@ -49,10 +49,10 @@ function style() {
|
||||||
.on('error', sass.logError)
|
.on('error', sass.logError)
|
||||||
.pipe(bytediff.start())
|
.pipe(bytediff.start())
|
||||||
.pipe(postcss([ autoprefixer()]))
|
.pipe(postcss([ autoprefixer()]))
|
||||||
.pipe(bytediff.stop((data) => formatByteMessage("autoprefixer", data)))
|
.pipe(bytediff.stop((data) => formatByteMessage('autoprefixer', data)))
|
||||||
.pipe(bytediff.start())
|
.pipe(bytediff.start())
|
||||||
.pipe(postcss([cssnano()]))
|
.pipe(postcss([cssnano()]))
|
||||||
.pipe(bytediff.stop((data) => formatByteMessage("cssnano", data)))
|
.pipe(bytediff.stop((data) => formatByteMessage('cssnano', data)))
|
||||||
.pipe(sourcemaps.write('.'))
|
.pipe(sourcemaps.write('.'))
|
||||||
.pipe(gulp.dest(paths.styles.dest))
|
.pipe(gulp.dest(paths.styles.dest))
|
||||||
.pipe(browserSync.stream())
|
.pipe(browserSync.stream())
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue