SCSS/SASS Multiple Sites in Multiple Directories
#!/bin/bash
for i in repoa repob repoc repod
do
compass watch "$i/pathtoyourconfig.rb" &
done
sass watching multiple directories
I'm hoping you've already tried it, but you can just add all folders into one command line:
sass --watch path/to/sass1:path/to/css1 path/to/sass2:path/to/css2 path/to/sass3:path/to/css3
Iterate through multiple folders to compile all SASS to CSS in Gulp
You can't put a globstar **
in your destination directory like this:
var output = './**/css';
That won't work, because gulp.dest()
can't magically guess from context which directory you want your files to end up in.
You have to explicitly construct a destination directory for each folder
returned from getFolders()
, just as you do for gulp.src()
:
var tasks = folders.map(function(folder) {
var src = path.join(scriptsPath, folder, 'scss');
var dst = path.join(scriptsPath, folder, 'css');
return gulp.src(path.join(src, '**/*.scss'))
.pipe(sourcemaps.init())
.pipe(sass(sassOptions).on('error', sass.logError))
.pipe(postcss(processors))
.pipe(sourcemaps.write('./maps'))
.pipe(gulp.dest(dst));
});
Watch multiple directories using gulp-sass
You need to provide the relative path to the sass files that you're importing. So change the import code to be something like this:
@import "forms";
@import "../../common/styles/_mixins";
@import "../../common/styles/_common";
Then, since you are importing the files from ./common/styles
you should only need gulp to target the scss file in ./blog/styles
. So your gulp function could look something like this:
gulp.task('sass', function() {
gulp.src('./blog/styles/blog.scss')
.pipe(sass())
.pipe(gulp.dest('./dist/style.css'));
});
Related Topics
Centering an Image in a Paragraph
Sass: Set Variable at Compile Time
CSS Is Not Loaded at All in Internet Explorer (Sec7113)
Create Clip-Path Wave CSS Edges
Chrome/Firefox Percentage Height Differences in CSS Grid
Css: How to Select Data Value Greater Than
How to Center Text Inside a Li Element Inside an Unordered List
Flow Multi-Column Elements Left-Right Before Top-Down
Colouring of Table Rows Alternatively
Border-Radius: 50% Not Producing Perfect Circles in Chrome
Updated CSS Stylesheet Not Loaded Following Deployment to Heroku
How to Create a Curve Tail for Speech Bubble with CSS
How to Allow Flex-Items to Grow While Keeping the Same Size
How to Create Vertical Text Using Only CSS
IE7 Absolute Element Appearing Behind Relative One