Skip to content
This repository has been archived by the owner on Feb 12, 2022. It is now read-only.

Gh1044 restructure less build to allow ampersand to not have fuelux in parents #1047

5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,7 @@ SAUCE_API_KEY.yml
.idea

# node_module cache for TravisCI, etc.
node_modules.tar.gz
node_modules.tar.gz

# Temp file created in the LESS build
less/fuelux-no-namespace.less
31 changes: 27 additions & 4 deletions Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,8 @@ module.exports = function(grunt) {
sourceMapFilename: 'dist/css/<%= pkg.name %>.css.map'
},
files: {
'dist/css/fuelux.css': 'less/fuelux.less'
'less/fuelux-no-namespace.less': 'less/fuelux.less'
, 'dist/css/fuelux.css': 'less/fuelux-namespace.less'
}
},
minify: {
Expand All @@ -235,7 +236,8 @@ module.exports = function(grunt) {
files: {
'dist/css/<%= pkg.name %>.min.css': 'dist/css/<%= pkg.name %>.css'
}
}
},

},
replace: {
readme: {
Expand Down Expand Up @@ -371,7 +373,18 @@ module.exports = function(grunt) {
grunt.registerTask('distjs', 'concat, uglify, and beautifying JS', ['concat', 'uglify', 'jsbeautifier']);

// CSS distribution task
grunt.registerTask('distcss', 'Compile LESS into CSS', ['less', 'usebanner']);
grunt.registerTask('distcss', 'Compile LESS into CSS', ['less', 'usebanner', 'delete-temp-less-file']);

// Temporary LESS file deletion task
grunt.registerTask('delete-temp-less-file', 'Delete the temporary LESS file created during the build process', function() {
var options = {
force: true
};
grunt.file.delete('less/fuelux-no-namespace.less', options)
});




// ZIP distribution task
grunt.registerTask('distzip', 'Compress and zip "dist"', ['copy:zipsrc', 'compress', 'clean:zipsrc']);
Expand Down Expand Up @@ -413,12 +426,22 @@ module.exports = function(grunt) {
grunt.task.run(['bump-only:' + versionReleaseType, 'dist', 'replace:readme']);
});


/* -------------
SERVEFAST
------------- */
grunt.registerTask('servefast', 'Serve the files with no "dist" build or tests. Optional --no-less to also disabled compiling less into css.', function() {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

disabled -> disable

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

several trivial jshint errors here too actually, I'm fixing so I can merge the PR.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, I couldn't figure out on a Friday afternoon what the heck was going on with travis errors.

Nor am I sure why or how they were introduced.

I am gonna dig in and look at what happened, but... you didn't remove the enhancements to "servefast" did you?

Those kinda sneaked in this, but were the result of an afternoon playing with it with @interactivellama .

if (! grunt.option('no-less') ) {
grunt.task.run(['distcss']);
}
grunt.task.run(['connect:server', 'watch:css']);
});

/* -------------
SERVE
------------- */
// use '--no-livereload' to disable livereload
grunt.registerTask('serve', 'serve files without "dist" build', ['test', 'connect:server', 'watch:contrib']);
grunt.registerTask('servefast', 'serve files w/o "dist" build or tests', ['connect:server', 'watch:contrib']);
grunt.registerTask('servedist', 'test, build "dist", serve files w/ watch', ['test', 'dist', 'connect:server', 'watch:full']);


Expand Down
5 changes: 5 additions & 0 deletions less/fuelux-namespace.less
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
@charset "UTF-8";

.fuelux {
@import "fuelux-no-namespace.less";
}
53 changes: 25 additions & 28 deletions less/fuelux.less
Original file line number Diff line number Diff line change
@@ -1,32 +1,29 @@
@charset "UTF-8";

.fuelux {

// Core variables, mixins, and icons
@import "variables.less"; // Modify this for custom colors, font-sizes, etc
@import "mixins.less";
@import "icons.less";
// Core variables, mixins, and icons
@import "variables.less"; // Modify this for custom colors, font-sizes, etc
@import "mixins.less";
@import "icons.less";

// Fuel UX controls
@import "checkbox.less";
@import "combobox.less";
@import "datepicker.less";
@import "infinite-scroll.less";
@import "intelligent-dropdown.less";
@import "loader.less";
@import "misc.less";
@import "pillbox.less";
@import "placard.less";
@import "radio.less";
@import "repeater.less";
@import "repeater-list.less";
@import "repeater-thumbnail.less";
@import "spinbox.less";
@import "scheduler.less";
@import "search.less";
@import "selectlist.less";
@import "tree.less";
@import "wizard.less";
@import "utility.less";

}
// Fuel UX controls
@import "checkbox.less";
@import "combobox.less";
@import "datepicker.less";
@import "infinite-scroll.less";
@import "intelligent-dropdown.less";
@import "loader.less";
@import "misc.less";
@import "pillbox.less";
@import "placard.less";
@import "radio.less";
@import "repeater.less";
@import "repeater-list.less";
@import "repeater-thumbnail.less";
@import "spinbox.less";
@import "scheduler.less";
@import "search.less";
@import "selectlist.less";
@import "tree.less";
@import "wizard.less";
@import "utility.less";