From 7b5ce7e0c3bc924c064f3bf19c136903d64cf75e Mon Sep 17 00:00:00 2001 From: Gleb Mazovetskiy Date: Tue, 19 Aug 2014 18:28:21 +0200 Subject: [PATCH] bootstrap.scss -> _bootstrap.scss #694 --- README.md | 4 ++-- .../stylesheets/{bootstrap.scss => _bootstrap.scss} | 0 .../bootstrap/{bootstrap.scss => _bootstrap.scss} | 0 bower.json | 2 +- tasks/bower.rake | 2 +- tasks/converter/less_conversion.rb | 13 +++++-------- test/compilation_test.rb | 2 +- 7 files changed, 10 insertions(+), 13 deletions(-) rename assets/stylesheets/{bootstrap.scss => _bootstrap.scss} (100%) rename assets/stylesheets/bootstrap/{bootstrap.scss => _bootstrap.scss} (100%) diff --git a/README.md b/README.md index 987740d6..148305c9 100644 --- a/README.md +++ b/README.md @@ -159,8 +159,8 @@ See also this [example manifest.js](/test/dummy_node_mincer/manifest.js) for min By default all of Bootstrap is imported. You can also import components explicitly. To start with a full list of modules copy -[`bootstrap.scss`](assets/stylesheets/bootstrap.scss) file into your assets as `bootstrap-custom.scss`. -Then comment out components you do not want from `bootstrap-custom`. +[`_bootstrap.scss`](assets/stylesheets/_bootstrap.scss) file into your assets as `_bootstrap-custom.scss`. +Then comment out components you do not want from `_bootstrap-custom`. In the application Sass file, replace `@import 'bootstrap'` with: ```scss diff --git a/assets/stylesheets/bootstrap.scss b/assets/stylesheets/_bootstrap.scss similarity index 100% rename from assets/stylesheets/bootstrap.scss rename to assets/stylesheets/_bootstrap.scss diff --git a/assets/stylesheets/bootstrap/bootstrap.scss b/assets/stylesheets/bootstrap/_bootstrap.scss similarity index 100% rename from assets/stylesheets/bootstrap/bootstrap.scss rename to assets/stylesheets/bootstrap/_bootstrap.scss diff --git a/bower.json b/bower.json index d9d575fc..c815772b 100644 --- a/bower.json +++ b/bower.json @@ -10,7 +10,7 @@ ], "description": "bootstrap-sass is a Sass-powered version of Bootstrap, ready to drop right into your Sass powered applications.", "main": [ - "assets/stylesheets/bootstrap.scss", + "assets/stylesheets/_bootstrap.scss", "assets/fonts/bootstrap/glyphicons-halflings-regular.eot", "assets/fonts/bootstrap/glyphicons-halflings-regular.svg", "assets/fonts/bootstrap/glyphicons-halflings-regular.ttf", diff --git a/tasks/bower.rake b/tasks/bower.rake index 16e484fd..d86b8bc7 100644 --- a/tasks/bower.rake +++ b/tasks/bower.rake @@ -20,7 +20,7 @@ namespace :bower do end.compact spec['main'] = - find_files.(File.join(Bootstrap.stylesheets_path, 'bootstrap.scss')) + + find_files.(File.join(Bootstrap.stylesheets_path, '_bootstrap.scss')) + find_files.(Bootstrap.fonts_path) + js_paths diff --git a/tasks/converter/less_conversion.rb b/tasks/converter/less_conversion.rb index 85938c19..820b9f4b 100644 --- a/tasks/converter/less_conversion.rb +++ b/tasks/converter/less_conversion.rb @@ -125,18 +125,15 @@ class Converter file = replace_all(file, " @include bg-variant($brand-primary);\n}", "}\n@include bg-variant('.bg-primary', $brand-primary);") end - name = name.sub(/\.less$/, '.scss') - path = File.join save_to, name - unless name == 'bootstrap.scss' - path = File.join File.dirname(path), '_' + File.basename(path) - end + path = File.join save_to, name.sub(/\.less$/, '.scss') + path = File.join File.dirname(path), '_' + File.basename(path) save_file(path, file) log_processed File.basename(path) end - # generate imports valid relative to both load path and file directory - save_file File.expand_path("#{save_to}/../bootstrap.scss"), - File.read("#{save_to}/bootstrap.scss").gsub(/ "/, ' "bootstrap/') + # move bootstrap/_bootstrap.scss to _bootstrap.scss adjusting import paths + save_file File.expand_path("#{save_to}/../_bootstrap.scss"), + File.read("#{save_to}/_bootstrap.scss").gsub(/ "/, ' "bootstrap/') end def bootstrap_less_files diff --git a/test/compilation_test.rb b/test/compilation_test.rb index 86c5d4d3..2cf4e722 100644 --- a/test/compilation_test.rb +++ b/test/compilation_test.rb @@ -4,7 +4,7 @@ require 'fileutils' class CompilationTest < Test::Unit::TestCase def test_compilation path = 'assets/stylesheets' - %w(bootstrap bootstrap/_theme).each do |file| + %w(_bootstrap bootstrap/_theme).each do |file| engine = Sass::Engine.for_file("#{path}/#{file}.scss", syntax: :scss, load_paths: [path]) assert_nothing_raised do FileUtils.mkdir_p("tmp/#{File.dirname(file)}")