diff options
Diffstat (limited to 'Gruntfile.js')
-rw-r--r-- | Gruntfile.js | 19 |
1 files changed, 12 insertions, 7 deletions
diff --git a/Gruntfile.js b/Gruntfile.js index 0b209329..392e7e53 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -199,10 +199,10 @@ grunt.registerTask('build_scss', 'build a regular theme from scss', function(the grunt.config('buildtheme', theme); }); - /** - * Regex borrowed form - * https://gist.github.com/rosskevin/ddfe895091de2ca5f931 - * */ + /** + * Regex borrowed form + * https://gist.github.com/rosskevin/ddfe895091de2ca5f931 + * */ grunt.registerTask('convert_less', 'Convert less to scss using regular expression', function () { var convertBaseDir = ''; grunt.file.expand(convertBaseDir + '*/*.less').forEach(function (lessFile) { @@ -233,11 +233,16 @@ grunt.registerTask('build_scss', 'build a regular theme from scss', function(the // 11. replace icon-font-path value with conditional for asset helpers .replace(/(\$icon-font-path:).*;/g, '$1 if($bootstrap-sass-asset-helper, "bootstrap/", "../fonts/bootstrap/");') // 12. set bootswatch's web-font-path value as !default - .replace(/(\$web-font-path:.*);/g, '$1 !default;'); + .replace(/(\$web-font-path:.*);/g, '$1 !default;') + // 13. Remove the web-font mixin which breaks in libsass + .replace(/[\s\S][\s\S]@mixin web-font.*([\s\S]*?).*;([\s\S]*?)}([\s\S]*?)/,"") + // 14. Replace usage of the web-font mixin with variable interpolation + .replace(/@include web-font/,'@import url'); + if (/\/variables.less$/.test(lessFile)) { - // 13. set default value of $bootstrap-sass-asset-helper to false + // 15. set default value of $bootstrap-sass-asset-helper to false out = "$bootstrap-sass-asset-helper: false;\n" + out; - // 14. only assign variables if they haven't been previously set e.g. $var: #f00; > $var: #f00 !default; + // 16. only assign variables if they haven't been previously set e.g. $var: #f00; > $var: #f00 !default; out = out.replace(/^(\$.*);/gm, '$1 !default;'); } |