diff --git a/.gitignore b/.gitignore index d5d2a71d033af5bfa0f1418bd16018f31f73e37f..156e4b34ca9eac5b9261e03bded0a0af1524b8f0 100644 --- a/.gitignore +++ b/.gitignore @@ -23,3 +23,5 @@ import/solrmarc.log* /docker-compose.override.yml /docker-env.override.yml /.env +**/compiled.css +**/print.css \ No newline at end of file diff --git a/Gruntfile.js b/Gruntfile.js index 4e6e7c38cc4f14aefa1791010ad00fa52a102ba6..7b8ac2951f9ce5a38d30859c7e1886da4113a946 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -3,6 +3,10 @@ module.exports = function(grunt) { var fs = require('fs'); + /** + * @param {string} file + * @return {Array} retval - path to file as Array + */ function getLoadPaths(file) { var config; var parts = file.split('/'); @@ -201,9 +205,13 @@ module.exports = function(grunt) { var sassConfig = {}, path = require('path'), themeList = fs.readdirSync(path.resolve('themes')).filter(function (theme) { - return fs.existsSync(path.resolve('themes/' + theme + '/scss/compiled.scss')); + return fs.existsSync(path.resolve('themes/' + theme + '/scss/compiled.scss')) + || fs.existsSync(path.resolve('themes/' + theme + '/scss/print.scss')); }); + /** + * Define mapping of input (scss) to output files (css) for following sass task + */ for (var i in themeList) { var config = { options: { @@ -212,7 +220,7 @@ module.exports = function(grunt) { files: [{ expand: true, cwd: path.join('themes', themeList[i], 'scss'), - src: ['compiled.scss'], + src: ['compiled.scss', 'print.scss'], dest: path.join('themes', themeList[i], 'css'), ext: '.css' }] @@ -220,7 +228,14 @@ module.exports = function(grunt) { for (var key in this.data.options) { config.options[key] = this.data.options[key] + ''; } - config.options.includePaths = getLoadPaths('themes/' + themeList[i] + '/scss/compiled.scss'); + + /* get Array of unique input paths */ + config.options.includePaths = Array.from( + new Set( + getLoadPaths('themes/' + themeList[i] + '/scss/compiled.scss') + .concat(getLoadPaths('themes/' + themeList[i] + '/scss/print.scss')) + ) + ); sassConfig[themeList[i]] = config; } diff --git a/themes/finc/css/.gitignore b/themes/finc/css/.gitignore deleted file mode 100644 index ecd34d2f94d3375699b58fb65ea6fa5b0aba96d1..0000000000000000000000000000000000000000 --- a/themes/finc/css/.gitignore +++ /dev/null @@ -1 +0,0 @@ -compiled.css \ No newline at end of file