gulp-sass

Gulp condition inside pipe

家住魔仙堡 提交于 2021-02-05 20:48:21
问题 How can I do a condition inside Gulp pipe to output to a different destination. g.task('sass', function() { return g.src(sources.sass).pipe(changed(output.css)).pipe(sass({ style: 'compressed', sourcemap: true })).pipe(function() { if (..) { g.dest(output.css); } else { g.dest(output.css2); } }).pipe(notify('scss converted to css and compressed <%=f ile.relative %>')); }); 回答1: Use the gulp-if plugin: var gulpif = require('gulp-if'); g.task('sass', function() { return g.src(sources.sass)

Node.js error - return process.dlopen(module, path._makeLong(filename));

依然范特西╮ 提交于 2021-01-27 06:19:12
问题 Getting below error for return process.dlopen(module, path._makeLong(filename)) module.js:597 return process.dlopen(module, path._makeLong(filename)); ^ Error: The specified procedure could not be found. \\?\C:\SLIM_WORKSPACE\slim\slim-web\node_modules\gulp-sass\node_modules\node-sass\vendor\win32-x64\binding.node at Error (native) at Object.Module._extensions..node (module.js:597:18) at Module.load (module.js:487:32) at tryModuleLoad (module.js:446:12) at Function.Module._load (module.js:438

Gulp-sass wont compile and include all imported files

筅森魡賤 提交于 2020-02-08 10:00:07
问题 Below is my import statment @import '../../node_modules/@syncfusion/ej2-angular-grids/styles/material.scss'; .checking { @import '../../node_modules/@syncfusion/ej2-angular-grids/styles/material-dark.scss'; } my gulp task is like below: gulp.task('styles', function () { sass.compiler = require('node-sass'); return gulp.src("./check/*.scss") .pipe(sass({ outputStyle: 'expanded', includePaths: ["./node_modules/@syncfusion/"] })) .pipe(sass.sync().on('error', sass.logError)) .pipe(gulp.dest('.

gulp: set multiple gulp.src and respective gulp.dest (on gulp-sass example)

老子叫甜甜 提交于 2020-01-25 08:04:32
问题 Project structure: 📁 development  📁 public   📁 pug   📁 1sass   📁 2css  📁 admin   📁 pug   📁 3sass   📁 4css       I add digits to folder names to imitate the situations when gulp can not guess somehow which output folder is respects to input ones. Now, I want to compile .sass files in public/1sass and admin/3sass to .css and put it in public/2css and admin/4css respectively: 📁 public/1sass → 📁 public/2css 📁 admin/3sass → 📁 admin/4css How I need to setup the sass task in gulpfile ? Even if we

gulp-sass @import CSS file

允我心安 提交于 2020-01-23 05:01:45
问题 Using gulp-sass I can include .scss files with @import 'filepath.scss'; But when I try to import normal css files with @import 'filepath.css' , It just added the import line of import url(filepath.css); to the output css file, rather than actually importing the code. How can I import CSS files as well as SCSS files? I want to do this to include files form bower. Here is my gulp function: // include gulp var gulp = require('gulp'); // include deps var minifyCSS = require('gulp-minify-css'),

Generate sourcemap for each partial

一个人想着一个人 提交于 2020-01-07 07:42:10
问题 I'm using the gulp-sass and would like for each partials he manages a sourcemap , I can do this using the less but did not see a way to do this with sass. _partial.scss ( within it have to have a mapfile ). _partial2.scss ( this also ). 回答1: According the specification from sass-lang files starting with a _ are not compilled. See also: https://github.com/sass/node-sass/issues/215 So rename your partials with gulp-rename: var sourcemaps = require('gulp-sourcemaps'); var gulp = require('gulp');

Use trailing ampersand (&) as a class combination selector, not a descendant selector

断了今生、忘了曾经 提交于 2020-01-05 04:15:30
问题 I want to apply a class .highlight to a bunch of different elements and style them according to the element type. I could do this: input[type="text"].highlight {...} select.highlight {...} someOtherSelector.hightlight {...} But I'm trying to use the trailing ampersand (&) to make my code more succinct. I've tried the following: .highlight { input[type="text"].& { border: 1px solid $brand-purple; } } But I get the following error: Error: property "input" must be followed by a ':' I've also