Skip to content

Instantly share code, notes, and snippets.

@EdCharbeneau
Last active February 3, 2022 21:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save EdCharbeneau/c03b30eb3f2b966c7dcf596a62c47414 to your computer and use it in GitHub Desktop.
Save EdCharbeneau/c03b30eb3f2b966c7dcf596a62c47414 to your computer and use it in GitHub Desktop.
Minimal Gulp for Telerik Themes

Requires npm install --global gulp-cli

@import "~@progress/kendo-theme-bootstrap/dist/all";
const path = require('path');
const gulp = require('gulp');
const sass = require('gulp-sass')(require('sass'));
// An importer that redirects relative URLs starting with "~" to
// `node_modules`.
function packageImporter(url) {
// If the doesn't start with ~, return it as is.
if (!url.startsWith('~')) {
return null;
}
const nodeModules = path.resolve('./node_modules');
// Create a new url to the correct location
const file = path.resolve(
nodeModules,
url.slice(1)
);
return { file };
}
gulp.task('sass', function () {
return gulp.src('./sass/**/*.scss')
.pipe(sass({ importer: [packageImporter]}).on('error', sass.logError))
.pipe(gulp.dest('./wwwroot/css'));
});
{
"name": "sass-theme",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"author": "",
"license": "ISC",
"devDependencies": {
"sass": "^1.49.7",
"@progress/kendo-theme-bootstrap": "^5.1.1",
"gulp": "^4.0.2",
"gulp-sass": "^5.1.0"
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment