Commit 5687f224 authored by Aaron Wells's avatar Aaron Wells

Bug 1495364: Remove compiled CSS from repo

Devs will now need to compile the CSS themeselves.
Added a "make css" step to the Makefile for this.

behatnotneeded

Change-Id: If1e85674e46e3c40dd861c8dd240c93735639fc6
parent 6f81244f
all:
all: css
css:
ifeq (, $(shell which npm))
$(error ERROR: Can't find the "npm" executable. Try "sudo apt-get install npm")
endif
ifeq (, $(shell which node))
$(error ERROR: Can't find the "node" executable. Try "sudo apt-get install nodejs-legacy")
endif
ifeq (, $(shell which gulp))
$(error ERROR: Can't find the "gulp" executable. Try doing "sudo npm install -g gulp")
endif
ifndef npmsetup
npm install
endif
@echo "Building CSS..."
@if gulp css ; then echo "Done!"; else npm install; gulp css; fi
clean-css:
find ./htdocs/theme/* -path './style' -type d -exec rm -Rf {} \;
help:
@echo "Run 'make' to do "build" Mahara (currently only CSS)"
@echo "Run 'make initcomposer' to install Composer and phpunit"
@echo "Run 'make phpunit' to execute phpunit tests"
@echo "Run 'make imageoptim' to losslessly optimise all images"
......
// Include gulp
var gulp = require('gulp-help')(require('gulp'));
//Polyfill so we don't need >= node 0.12
require('es6-promise').polyfill();
// Include Our Plugins
var sass = require('gulp-sass');
var path = require('path');
var minifyCSS = require('gulp-minify-css');
var autoprefixer = require('gulp-autoprefixer');
var bless = require('gulp-bless');
var es = require('event-stream');
var globule = require('globule');
// Locate all the themes (they're the directories with a "themeconfig.php" in them)
var themes = globule.find('htdocs/theme/*/themeconfig.php');
themes = themes.map(function(themepath){
themepath = path.join(themepath, '..');
return themepath;
});
// Turn sass into css
gulp.task('css', 'Compile SASS into CSS', function () {
var tasks = themes.map(function(themepath){
console.log("Compiling CSS for " + themepath);
return gulp.src('sass/**/*.scss', {cwd: themepath})
.pipe(sass().on('error', sass.logError))
.pipe(autoprefixer({
browsers: ['last 4 version'],
cascade: false
}))
.pipe(minifyCSS())
.pipe(bless())
.pipe(gulp.dest('style/', {cwd: themepath}));
});
return es.concat.apply(null, tasks);
});
// Watch Files For Changes
gulp.task('watch', 'Watch style directories and auto-compile CSS', function() {
gulp.watch('htdocs/theme/**/sass/**/*.scss', ['css']);
});
style/
\ No newline at end of file
This source diff could not be displayed because it is too large. You can view the blob instead.
style/
\ No newline at end of file
style/
\ No newline at end of file
This source diff could not be displayed because it is too large. You can view the blob instead.
style/
\ No newline at end of file
.ui-datepicker{font-size:.7em}.ui-datepicker .ui-datepicker-next-year,.ui-datepicker .ui-datepicker-prev-year{height:1.8em;position:absolute;top:2px;width:1.8em}.ui-datepicker .ui-datepicker-prev-year{left:2px}.ui-datepicker .ui-datepicker-next-year{right:2px}.ui-datepicker .ui-datepicker-next-year span,.ui-datepicker .ui-datepicker-prev-year span{display:block;left:50%;margin-left:-7px;margin-top:-8px;position:absolute;top:50%}.ui-datepicker .ui-datepicker-next-year-hover,.ui-datepicker .ui-datepicker-prev-year-hover{top:1px}.ui-datepicker .ui-datepicker-next-year-hover span,.ui-datepicker .ui-datepicker-prev-year-hover span{margin-left:-8px}.ui-datepicker .ui-datepicker-next-year span{margin-left:-9px}.ui-datepicker .ui-datepicker-next-year-hover span{margin-left:-8px}.ui-datepicker .ui-datepicker-next span,.ui-datepicker .ui-datepicker-prev span{margin-left:-7px}.ui-datepicker .ui-datepicker-next-hover span,.ui-datepicker .ui-datepicker-prev-hover span{margin-left:-8px}.ui-datepicker .ui-datepicker-prev{left:23px}.ui-datepicker .ui-datepicker-next{right:23px}.ui-datepicker .ui-datepicker-next span{margin-left:-9px}.ui-datepicker .ui-datepicker-next-hover span{margin-left:-8px}.ui-datepicker button.ui-priority-secondary{opacity:1;font-weight:700}.ui-icon-circle-triangle-wy{background-position:-144px -192px}.ui-icon-circle-triangle-ey{background-position:-112px -192px}.ui-timepicker-div .ui-widget-header{margin-bottom:8px}.ui-timepicker-div dl{text-align:left}.ui-timepicker-div dl dt{float:left;clear:left;padding:0 0 0 5px}.ui-timepicker-div dl dd{margin:0 10px 10px 40%}.ui-timepicker-div td{font-size:90%}.ui-tpicker-grid-label{background:0 0;border:none;margin:0;padding:0}.ui-timepicker-rtl{direction:rtl}.ui-timepicker-rtl dl{text-align:right;padding:0 5px 0 0}.ui-timepicker-rtl dl dt{float:right;clear:right}.ui-timepicker-rtl dl dd{margin:0 40% 10px 10px}
\ No newline at end of file
This diff is collapsed.
This source diff could not be displayed because it is too large. You can view the blob instead.
This diff is collapsed.
This diff is collapsed.
style/
\ No newline at end of file
{
"name": "mahara-themes",
"version": "1.0.0",
"description": "Compiles SASS files into CSS for all Mahara themes",
"main": "gulpfile.js",
"dependencies": {
"gulp": "^3.9.0",
"gulp-minify-css": "^1.1.6",
"gulp-sass": "^2.0.1",
"gulp-help": "^1.6.1",
"path": "^0.11.14",
"event-stream": "^3.3.1",
"globule": "^0.2.0",
"gulp-bless": "^3.0.1",
"gulp-autoprefixer": "^3.0.1",
"es6-promise": "^3.0.2"
},
"devDependencies": {},
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment