JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 117
  • Score
    100M100P100Q76570F
  • License MIT

Compile SASS files with different theme (variables) files.

Package Exports

  • gulp-sass-themes

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (gulp-sass-themes) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

gulp-sass-themes

A plugin for Gulp as extension of gulp-sass.

Install

npm install gulp-sass-themes gulp-sass --save-dev

Basic Usage

Source files

├── styles
    ├── body.themed.scss
    └── themes
        ├── _red.scss
        └── _blue.scss

Gulpfile

'use strict';

const gulp = require('gulp');
const sass = require('gulp-sass');
const sassThemes = require('gulp-sass-themes');

gulp.task('styles', () => gulp.src('./styles/**/*.scss')
  .pipe(sassThemes('./styles/themes/_*.scss'))
  .pipe(sass()).on('error', sass.logError)
  .pipe(gulp.dest('./dist/styles'))
);

Output

├── dist
    └── styles
        ├── body.red.css
        └── body.blue.css

Parameters

themes

Type: String | Array<String>

Glob pattern to theme files.

options

cwd

Type: String

Current working directory for glob pattern.

placeholder

Type: RegExp

Regular expression to match and replace placeholder in file. The first parentheses-captured matched result will be replaced with the theme name.

Default is /^.+\.(themed)\.(scss|sass)$/.