mirror of
https://github.com/kogakure/website-astro-stefanimhoff.de.git
synced 2026-02-03 20:15:27 +00:00
chore: replace SVG cover image with PNG
This commit is contained in:
@@ -4,7 +4,7 @@ slug: gulp-tutorial-16-postcss
|
||||
author: Stefan Imhoff
|
||||
date: 2014-12-30T07:50:29+00:00
|
||||
description: "The ultimate tutorial and guide for Gulp.js: How to use PostCSS with Gulp to process CSS and how to lint your CSS files with Stylelint."
|
||||
cover: /assets/images/cover/gulp.svg
|
||||
cover: /assets/images/cover/gulp.jpg
|
||||
tags: ["code"]
|
||||
series: gulp
|
||||
---
|
||||
@@ -86,9 +86,9 @@ var mqpacker = require("css-mqpacker");
|
||||
var config = require("../../config");
|
||||
|
||||
function onError(err) {
|
||||
gutil.beep();
|
||||
console.log(err);
|
||||
this.emit("end");
|
||||
gutil.beep();
|
||||
console.log(err);
|
||||
this.emit("end");
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -96,26 +96,26 @@ function onError(err) {
|
||||
* Build sourcemaps and minimize
|
||||
*/
|
||||
var processors = [
|
||||
precss(config.styles.options.precss),
|
||||
autoprefixer(config.styles.options.autoprefixer),
|
||||
mqpacker(config.styles.options.mqpacker),
|
||||
precss(config.styles.options.precss),
|
||||
autoprefixer(config.styles.options.autoprefixer),
|
||||
mqpacker(config.styles.options.mqpacker),
|
||||
];
|
||||
|
||||
gulp.task("styles", function () {
|
||||
browsersync.notify("Transforming CSS with PostCSS");
|
||||
browsersync.notify("Transforming CSS with PostCSS");
|
||||
|
||||
return gulp
|
||||
.src(config.styles.src)
|
||||
.pipe(
|
||||
plumber({
|
||||
errorHandler: onError,
|
||||
})
|
||||
)
|
||||
.pipe(sourcemaps.init())
|
||||
.pipe(postcss(processors))
|
||||
.pipe(nano())
|
||||
.pipe(sourcemaps.write("."))
|
||||
.pipe(gulp.dest(config.styles.dest));
|
||||
return gulp
|
||||
.src(config.styles.src)
|
||||
.pipe(
|
||||
plumber({
|
||||
errorHandler: onError,
|
||||
})
|
||||
)
|
||||
.pipe(sourcemaps.init())
|
||||
.pipe(postcss(processors))
|
||||
.pipe(nano())
|
||||
.pipe(sourcemaps.write("."))
|
||||
.pipe(gulp.dest(config.styles.dest));
|
||||
});
|
||||
```
|
||||
|
||||
@@ -275,14 +275,14 @@ var reporter = require("postcss-reporter");
|
||||
var config = require("../../config");
|
||||
|
||||
gulp.task("lint-styles", function () {
|
||||
return gulp
|
||||
.src(config.lintStyles.src)
|
||||
.pipe(
|
||||
postcss([
|
||||
stylelint(config.lintStyles.options.stylelint),
|
||||
reporter(config.lintStyles.options.reporter),
|
||||
])
|
||||
);
|
||||
return gulp
|
||||
.src(config.lintStyles.src)
|
||||
.pipe(
|
||||
postcss([
|
||||
stylelint(config.lintStyles.options.stylelint),
|
||||
reporter(config.lintStyles.options.reporter),
|
||||
])
|
||||
);
|
||||
});
|
||||
```
|
||||
|
||||
@@ -306,5 +306,5 @@ I’m sure we will see more exciting Plugins in the future.
|
||||
This concludes the 16th part of my series _Introduction to Gulp.js_. We learned how to use PostCSS to process our CSS files and how to use Stylelint to lint the CSS files for errors.
|
||||
|
||||
<Figure>
|
||||
<MoreLink href="https://github.com/kogakure/gulp-tutorial" text="View Source on GitHub" />
|
||||
<MoreLink href="https://github.com/kogakure/gulp-tutorial" text="View Source on GitHub" />
|
||||
</Figure>
|
||||
|
||||
Reference in New Issue
Block a user