diff options
author | Jay Williams <jay@myd3.com> | 2015-05-14 20:44:45 -0500 |
---|---|---|
committer | Jay Williams <jay@myd3.com> | 2015-05-14 20:44:45 -0500 |
commit | 95f3901beb9c2bfe278277235ef8ce46690dba5e (patch) | |
tree | 0018d0563a3f1dcaf8e8205a1978497f6159a525 | |
parent | 1c7f6ff90edce3815ae9fa32b951f68db35fa275 (diff) |
Add !default flag to each sass variable
-rw-r--r-- | Gruntfile.js | 4 |
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'); |