From 95f3901beb9c2bfe278277235ef8ce46690dba5e Mon Sep 17 00:00:00 2001 From: Jay Williams Date: Thu, 14 May 2015 20:44:45 -0500 Subject: Add !default flag to each sass variable --- Gruntfile.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Gruntfile.js b/Gruntfile.js index c21bfeb6..d8dbc5a6 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -230,6 +230,10 @@ grunt.registerTask('build_scss', 'build a regular theme from scss', function(the // 10. replace bower and imports in build.scss .replace(/bootstrap\/less\//g, 'bootstrap-sass-official/assets/stylesheets/') .replace(/\.less/g, ''); + // 11. only assign variables if they haven't been previously set e.g. $var: #f00; > $var: #f00 !default; + if (/\/variables.less$/.test(lessFile)) { + out = out.replace(/^(\$.*);/gm, '$1 !default;'); + } var baseDirRegex = new RegExp("^" + convertBaseDir, "g"); var sassFile = lessFile.replace(baseDirRegex, '').replace(/\.less$/, '.scss').replace(/(bootswatch|variables)/, '_$1'); -- cgit v1.2.3