summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJay Williams <jay@myd3.com>2015-05-14 20:44:45 -0500
committerJay Williams <jay@myd3.com>2015-05-14 20:44:45 -0500
commit95f3901beb9c2bfe278277235ef8ce46690dba5e (patch)
tree0018d0563a3f1dcaf8e8205a1978497f6159a525
parent1c7f6ff90edce3815ae9fa32b951f68db35fa275 (diff)
Add !default flag to each sass variable
-rw-r--r--Gruntfile.js4
1 files changed, 4 insertions, 0 deletions
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');