Skip to content
This repository has been archived by the owner on Jun 18, 2024. It is now read-only.

Commit

Permalink
Merge pull request #303 from OfficeDev/miwhea/remove-less
Browse files Browse the repository at this point in the history
Remove LESS
  • Loading branch information
gokunymbus committed Feb 5, 2016
2 parents f86bfca + 8cf9c19 commit c722fe8
Show file tree
Hide file tree
Showing 78 changed files with 51 additions and 11,164 deletions.
61 changes: 0 additions & 61 deletions .lesshintrc

This file was deleted.

3 changes: 2 additions & 1 deletion .sass-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,14 @@ rules:
variable-name-format: 0
mixin-name-format: 0
force-element-nesting: 0
nesting-depth: 0
clean-import-paths:
- 0
extends-before-mixins: 2
extends-before-declarations: 2
placeholder-in-extend: 2
mixins-before-declarations:
- 2
- 0
-
exclude:
- breakpoint
Expand Down
24 changes: 10 additions & 14 deletions gulp/ComponentSamples.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,21 +69,17 @@ gulp.task('ComponentSamples-moveJS', function() {
.pipe(gulp.dest(Config.paths.distSamples + '/Components'));
});

// Style Linting
// ----------------------------------------------------------------------------

gulp.task('ComponentSamples-styleHinting', function() {
if (!Config.buildSass) {
return gulp.src(Config.paths.componentsPath + '/**/*.less')
.pipe(Plugins.gulpif(Config.debugMode, Plugins.debug({
title: "Checking LESS Compile errors and linting"
})))
.pipe(Plugins.lesshint({
configPath: './.lesshintrc'
}))
.pipe(ErrorHandling.LESSHintErrors());
}
});
return gulp.src(Config.paths.componentsPath + '/**/*.scss')
.pipe(Plugins.plumber(ErrorHandling.onErrorInPipe))
.pipe(Plugins.gulpif(Config.debugMode, Plugins.debug({
title: "Checking SASS Compile errors and linting"
})))
.pipe(Plugins.sasslint())
.pipe(ErrorHandling.SASSlintErrors());

});

//
// Styles tasks
Expand Down Expand Up @@ -182,9 +178,9 @@ var ComponentSamplesTasks = [
'ComponentSamples-build',
'ComponentSamples-copyAssets',
'ComponentSamples-buildStyles',
'ComponentSamples-styleHinting',
'ComponentSamples-moveJS',
'ComponentSamples-copyIgnoredFiles'
// 'ComponentSamples-styleHinting' Commented out until warnings are resolved
];

//Build Fabric Component Samples
Expand Down
23 changes: 0 additions & 23 deletions gulp/ConfigureEnvironment.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,29 +4,6 @@ var BuildConfig = require('./modules/BuildConfig');
var Plugins = require('./modules/Plugins');
var ErrorHandling = require('./modules/ErrorHandling');


gulp.task('ConfigureEnvironment-setLessMode', function() {
Config.buildSass = false;
BuildConfig.template = 'component-manifest-template.less';
BuildConfig.srcPath = Config.paths.srcLess;
BuildConfig.processorPlugin = Plugins.less;
BuildConfig.fileExtension = Config.lessExtension;
BuildConfig.compileErrorHandler = ErrorHandling.LESSCompileErrors;
BuildConfig.processorName = "less";
return;
});

gulp.task('ConfigureEnvironment-setSassMode', function() {
Config.buildSass = true;
BuildConfig.template = 'component-manifest-template.scss';
BuildConfig.srcPath = Config.paths.srcSass;
BuildConfig.processorPlugin = Plugins.sass;
BuildConfig.fileExtension = Config.sassExtension;
BuildConfig.compileErrorHandler = ErrorHandling.SASSCompileErrors;
BuildConfig.processorName = "sass";
return;
});

gulp.task('ConfigureEnvironment-setDebugMode', function() {
Config.debugMode = true;
return;
Expand Down
46 changes: 10 additions & 36 deletions gulp/FabricBuild.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,59 +15,33 @@ var Plugins = require('./modules/Plugins');

// Clean out the distribution folder.
gulp.task('Fabric-nuke', function () {
return Plugins.del.sync([Config.paths.distLess, Config.paths.distCSS, Config.paths.distSass]);
});

//
// Style Linting
// ---------------------------------------------------------------------------
gulp.task('Fabric-styleHinting', function() {
if (!Config.buildSass) {
return gulp.src(Config.paths.srcLess + '/Fabric.less')
.pipe(Plugins.gulpif(Config.debugMode, Plugins.debug({
title: "Checking LESS Compile errors and linting"
})))
.pipe(Plugins.lesshint({
configPath: './.lesshintrc'
}))
.pipe(ErrorHandling.LESSHintErrors());

}
return Plugins.del.sync([Config.paths.distCSS, Config.paths.distSass]);
});


//
// Copying Files Tasks
// ----------------------------------------------------------------------------

// Copy all LESS files to distribution folder.
gulp.task('Fabric-copyAssets', function () {
// Copy LESS files.
var moveLess = gulp.src([Config.paths.srcLess + '/**/*'])
.pipe(Plugins.plumber(ErrorHandling.onErrorInPipe))
.pipe(Plugins.changed(Config.paths.distLess))
.pipe(Plugins.gulpif(Config.debugMode, Plugins.debug({
title: "Moving LESS Assets over to Dist"
})))
.pipe(gulp.dest(Config.paths.distLess));

// Copy all Sass files to distribution folder.
gulp.task('Fabric-copyAssets', function () {
var moveSass = gulp.src([Config.paths.srcSass + '/**/*'])
.pipe(Plugins.plumber(ErrorHandling.onErrorInPipe))
.pipe(Plugins.changed(Config.paths.distSass))
.pipe(Plugins.gulpif(Config.debugMode, Plugins.debug({
title: "Moving SASS files over to Dist"
title: "Moving Sass files over to Dist"
})))
.pipe(gulp.dest(Config.paths.distSass));
return Plugins.mergeStream(moveLess, moveSass);
return moveSass;
});

//
// LESS tasks
// Sass tasks
// ----------------------------------------------------------------------------

// Build LESS files for core Fabric into LTR and RTL CSS files.
// Build Sass files for core Fabric into LTR and RTL CSS files.

gulp.task('Fabric-buildStyles', ['Fabric-styleHinting'], function () {
gulp.task('Fabric-buildStyles', function () {
var fabric = gulp.src(BuildConfig.srcPath + '/' + 'Fabric.' + BuildConfig.fileExtension)
.pipe(Plugins.plumber(ErrorHandling.onErrorInPipe))
.pipe(Plugins.gulpif(Config.debugMode, Plugins.debug({
Expand Down Expand Up @@ -117,7 +91,7 @@ gulp.task('Fabric-buildStyles', ['Fabric-styleHinting'], function () {
// Rolled up Build tasks
// ----------------------------------------------------------------------------

gulp.task('Fabric', ['Fabric-copyAssets', 'Fabric-styleHinting', 'Fabric-buildStyles']);
gulp.task('Fabric', ['Fabric-copyAssets', 'Fabric-buildStyles']);

//
// Fabric Messages
Expand All @@ -137,7 +111,7 @@ gulp.task('Fabric-updated', ['Fabric'], function () {

// Watch and build Fabric when sources change.
gulp.task('Fabric-watch', ['Fabric', 'Fabric-finished'], function () {
return gulp.watch(Config.paths.lessPath + '/**/*', Plugins.batch(function (events, done) {
return gulp.watch(Config.paths.sassPath + '/**/*', Plugins.batch(function (events, done) {
Plugins.runSequence('Fabric', 'Fabric-updated', done);
}));
});
4 changes: 2 additions & 2 deletions gulp/FabricComponents.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,10 @@ gulp.task('FabricComponents-moveJs', function () {
});

//
// LESS tasks
// Sass tasks
// ----------------------------------------------------------------------------

// Build Components LESS files
// Build Components Sass files
gulp.task('FabricComponents-buildAndCombineStyles', function () {
var stream = gulp.src(BuildConfig.srcPath + '/Fabric.Components.' + BuildConfig.fileExtension)
.pipe(Plugins.plumber())
Expand Down
72 changes: 0 additions & 72 deletions gulp/SassConversion.js

This file was deleted.

16 changes: 10 additions & 6 deletions gulp/modules/BuildConfig.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,15 @@
/** Class for working adding banners to files */
var Config = require('./Config');
var Plugins = require('./Plugins');
var ErrorHandling = require('./ErrorHandling');

var BuildConfig = function() {
this.srcPath;
this.processorPlugin;
this.fileExtension;
this.template;
this.compileErrorHandler;
this.processorName;
this.srcPath = Config.paths.srcSass;
this.processorPlugin = Plugins.sass;
this.fileExtension = Config.sassExtension;
this.template = 'component-manifest-template.scss';
this.compileErrorHandler = ErrorHandling.SASSCompileErrors;
this.processorName = "sass";
};

module.exports = new BuildConfig();
2 changes: 1 addition & 1 deletion gulp/modules/ComponentHelper.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ var ComponentSamplesHelper = function() {
* @param {string} destFolder Contains the path to the destination folder.
* @param {string} srcTemplate Contains the path to the source template to be applied.
* @param {string} componentName Name of the component.
* @param {string} deps LESS Dependencies to be added to the styles.
* @param {string} deps Sass Dependencies to be added to the styles.
* @param {function} cssPlugin The gulp plugin or function used for the specific css preprocessor
* @return {stream} returns a stream.
*/
Expand Down
6 changes: 1 addition & 5 deletions gulp/modules/Config.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,13 @@ var pkg = require('../../package.json');
*/
var Config = function() {
this.debugMode = false;
this.lessExtension = "less";
this.sassExtension = "scss";
this.buildSass = false;
this.copyRightMessage = "Copyright (c) Microsoft. All rights reserved. Licensed under the MIT license. See LICENSE in the project root for license information.";
var distPath = 'dist';
var srcPath = 'src';
this.paths = {
distComponents: distPath + '/components',
distLess: distPath + '/less',
distSass: distPath + '/sass',
distCSS: distPath + '/css',
distSamples: distPath + '/samples',
Expand All @@ -25,7 +23,6 @@ var Config = function() {
srcSamples: srcPath + '/samples',
srcSass: srcPath + '/sass',
componentsPath : 'src/components',
srcLess: srcPath + '/less',
templatePath : srcPath + '/templates'
};
this.port = process.env.PORT || 2020;
Expand Down Expand Up @@ -57,8 +54,7 @@ var Config = function() {
{src: this.paths.distComponents, dest: "/content/components/"},
{src: this.paths.distCSS, dest: "/content/css/"},
{src: this.paths.distJS, dest: "/content/scripts/"},
{src: this.paths.distLess, dest: "/content/less/"},
{src: this.paths.distSass, dest: "/content/sass/"}
{src: this.paths.distSass, dest: "/content/sass/"}
];
this.componentSamplesUpdate = "Components Samples updated successfully! Yay!";
this.componentSamplesFinished = ' Component Samples build was successful! Yay!';
Expand Down
Loading

0 comments on commit c722fe8

Please sign in to comment.