diff options
author | Gleb Mazovetskiy <glex.spb@gmail.com> | 2017-08-15 23:00:55 +0300 |
---|---|---|
committer | Gleb Mazovetskiy <glex.spb@gmail.com> | 2017-08-15 23:03:36 +0300 |
commit | 7f6a060d6ca870eb6ef5c777d816d97646c0507a (patch) | |
tree | 63570408c87459280636f3359163edd2d0f25b8f /tasks/updater | |
parent | 4119c11b61eca608587813ccbf5774eb0c6304fa (diff) |
Variables template: import functions and variables
There are lots of questions on the issue tracker and StackOverflow about
why overriding a variable fails. In most of the cases, this happens when
the overriden variable value uses the value of another variable or a
function.
Importing variables and functions by default fixes most of
these issues.
Diffstat (limited to 'tasks/updater')
-rw-r--r-- | tasks/updater/scss.rb | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/tasks/updater/scss.rb b/tasks/updater/scss.rb index c747b9a..a99876e 100644 --- a/tasks/updater/scss.rb +++ b/tasks/updater/scss.rb @@ -23,11 +23,18 @@ class Updater end log_status 'Generating variable template file' + template_file_header = <<-SCSS +// Override Bootstrap variables here (defaults from bootstrap v#{upstream_version}): + +@import "bootstrap/functions"; +@import "bootstrap/variables"; + +SCSS save_file 'templates/project/_bootstrap-variables.scss', - "// Override Bootstrap variables here (defaults from bootstrap v#{upstream_version}):\n" + + template_file_header + File.read("#{save_to}/_variables.scss"). # The instructions in the file header are replaced with the line above - lines[4..-1]. + lines[5..-1]. join. # Comment out the assignments gsub(/^(?=[$@)}]|[ ]{2})/, '// '). |