J
J
JKaminsky2020-10-09 14:04:26
css
JKaminsky, 2020-10-09 14:04:26

Why doesn't the shorthand font: font-size/line-height, font-family compile with gulp-sass?

in the output file, the font property is missing
scss:

font: 19px "open sans";
line-height: 30px;
max-width: 550px;

css:
line-height: 30px;
max-width: 550px;

task:
var gulp = require("gulp");
var scss = require("gulp-sass");
var cleanCSS = require("gulp-clean-css");
const { series, parallel } = require("gulp");
gulp.task("scss", function () {
  return gulp
    .src("./css/scss/pages/*.scss")
    .pipe(scss())
    .pipe(cleanCSS({ level: 2 }))
    .pipe(gulp.dest("./css/"));
});
gulp.task("watch", function () {
  gulp.watch("./css/scss/**/*.scss", gulp.series("scss"));
});
gulp.task("default", gulp.series("watch"));


does not give any errors!

Answer the question

In order to leave comments, you need to log in

1 answer(s)
X
xdevelx, 2020-10-09
@develx

sass has nothing to do with it. It should compile as expected. But clean-css may have transformed the rule or moved it to another selector.
try without clean-css

gulp.task("scss", function () {
  return gulp
    .src("./css/scss/pages/*.scss")
    .pipe(scss())
    .pipe(gulp.dest("./css/"));
});

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question