mirror of
https://github.com/twbs/bootstrap-sass.git
synced 2022-11-09 12:27:02 -05:00
Revert relative imports change
This commit is contained in:
parent
dcdef9bfd8
commit
3c126b3d96
6 changed files with 28 additions and 17 deletions
|
@ -8,8 +8,8 @@
|
||||||
// Load core variables and mixins
|
// Load core variables and mixins
|
||||||
// --------------------------------------------------
|
// --------------------------------------------------
|
||||||
|
|
||||||
@import "bootstrap/variables";
|
@import "variables";
|
||||||
@import "bootstrap/mixins";
|
@import "mixins";
|
||||||
|
|
||||||
|
|
||||||
//
|
//
|
||||||
|
|
|
@ -124,8 +124,6 @@ class Converter
|
||||||
file = replace_all file, /(\s*)\.navbar-(right|left)\s*\{\s*@extend\s*\.pull-(right|left);\s*/, "\\1.navbar-\\2 {\\1 float: \\2 !important;\\1"
|
file = replace_all file, /(\s*)\.navbar-(right|left)\s*\{\s*@extend\s*\.pull-(right|left);\s*/, "\\1.navbar-\\2 {\\1 float: \\2 !important;\\1"
|
||||||
when 'tables.less'
|
when 'tables.less'
|
||||||
file = replace_all file, /(@include\s*table-row-variant\()(\w+)/, "\\1'\\2'"
|
file = replace_all file, /(@include\s*table-row-variant\()(\w+)/, "\\1'\\2'"
|
||||||
when 'theme.less'
|
|
||||||
file = replace_all file, /@import "/, '\0bootstrap/'
|
|
||||||
when 'thumbnails.less', 'labels.less', 'badges.less', 'buttons.less'
|
when 'thumbnails.less', 'labels.less', 'badges.less', 'buttons.less'
|
||||||
file = extract_nested_rule file, 'a&'
|
file = extract_nested_rule file, 'a&'
|
||||||
when 'glyphicons.less'
|
when 'glyphicons.less'
|
||||||
|
|
|
@ -3,16 +3,28 @@ require 'fileutils'
|
||||||
require 'sassc'
|
require 'sassc'
|
||||||
|
|
||||||
class CompilationTest < Minitest::Test
|
class CompilationTest < Minitest::Test
|
||||||
def test_compilation
|
def test_compilation_bootstrap
|
||||||
path = 'assets/stylesheets'
|
compile 'bootstrap'
|
||||||
%w(_bootstrap bootstrap/_theme).each do |file|
|
assert true # nothing was raised
|
||||||
FileUtils.rm_rf('.sass-cache', secure: true)
|
end
|
||||||
engine = SassC::Engine.new(File.read("#{path}/#{file}.scss"), syntax: :scss, load_paths: [path])
|
|
||||||
FileUtils.mkdir_p("tmp/#{File.dirname(file)}")
|
def test_compilation_bootstrap_theme
|
||||||
File.open("tmp/#{file}.css", 'w') { |f|
|
compile 'bootstrap/theme'
|
||||||
f.write engine.render
|
assert true # nothing was raised
|
||||||
}
|
end
|
||||||
assert true # nothing was raised
|
|
||||||
end
|
private
|
||||||
|
|
||||||
|
def compile(file)
|
||||||
|
path = File.expand_path('../assets/stylesheets', __dir__)
|
||||||
|
FileUtils.rm_rf('.sass-cache', secure: true)
|
||||||
|
engine = SassC::Engine.new(
|
||||||
|
%Q{@import "#{path}/#{file}"},
|
||||||
|
syntax: :scss, load_paths: ['.']
|
||||||
|
)
|
||||||
|
FileUtils.mkdir_p("tmp/#{File.dirname(file)}")
|
||||||
|
File.open("tmp/#{file}.css", 'w') { |f|
|
||||||
|
f.write engine.render
|
||||||
|
}
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
source 'https://rubygems.org'
|
source 'https://rubygems.org'
|
||||||
|
|
||||||
gem 'sassc', '>= 1.12.1'
|
gem 'sassc', '>= 2.0.0'
|
||||||
gem 'bootstrap-sass', path: '../..'
|
gem 'bootstrap-sass', path: '../..'
|
||||||
|
|
|
@ -9,7 +9,7 @@ out_path = ARGV[1]
|
||||||
|
|
||||||
output = SassC::Engine.new(
|
output = SassC::Engine.new(
|
||||||
File.read(File.expand_path('./import_all.scss', __dir__)),
|
File.read(File.expand_path('./import_all.scss', __dir__)),
|
||||||
syntax: :scss, load_paths: [load_path]
|
syntax: :scss, load_paths: ['.', load_path]
|
||||||
).render
|
).render
|
||||||
|
|
||||||
if out_path
|
if out_path
|
||||||
|
|
|
@ -3,6 +3,7 @@
|
||||||
require 'test_helper'
|
require 'test_helper'
|
||||||
require 'shellwords'
|
require 'shellwords'
|
||||||
require 'fileutils'
|
require 'fileutils'
|
||||||
|
require 'bootstrap-sass'
|
||||||
|
|
||||||
class SassTest < Minitest::Test
|
class SassTest < Minitest::Test
|
||||||
DUMMY_PATH = 'test/dummy_sass_only'
|
DUMMY_PATH = 'test/dummy_sass_only'
|
||||||
|
|
Loading…
Add table
Reference in a new issue