1
0
Fork 0
mirror of https://github.com/twbs/bootstrap-sass.git synced 2022-11-09 12:27:02 -05:00

bootstrap.scss -> _bootstrap.scss #694

This commit is contained in:
Gleb Mazovetskiy 2014-08-19 18:28:21 +02:00
parent 6d6a7fe36b
commit 7b5ce7e0c3
7 changed files with 10 additions and 13 deletions

View file

@ -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

View file

@ -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",

View file

@ -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

View file

@ -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

View file

@ -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)}")