diff options
-rw-r--r-- | Rakefile | 4 | ||||
-rw-r--r-- | bootstrap.gemspec | 6 | ||||
-rw-r--r-- | lib/bootstrap.rb | 11 |
3 files changed, 8 insertions, 13 deletions
@@ -45,13 +45,13 @@ end desc 'Dumps output to a CSS file for testing' task :debug do - require 'sass' + require 'sassc' require './lib/bootstrap' require 'term/ansicolor' require 'autoprefixer-rails' path = Bootstrap.stylesheets_path %w(_bootstrap _bootstrap-reboot _bootstrap-grid).each do |file| - engine = Sass::Engine.for_file("#{path}/#{file}.scss", syntax: :scss, load_paths: [path]) + engine = SassC::Engine.new(File.read("#{path}/#{file}.scss"), syntax: :scss, load_paths: [path]) out = File.join('tmp', "#{file[1..-1]}.css") css = engine.render css = AutoprefixerRails.process(css) diff --git a/bootstrap.gemspec b/bootstrap.gemspec index b202663..768820e 100644 --- a/bootstrap.gemspec +++ b/bootstrap.gemspec @@ -11,10 +11,10 @@ Gem::Specification.new do |s| s.homepage = 'https://github.com/twbs/bootstrap-rubygem' s.license = 'MIT' - s.add_runtime_dependency 'popper_js', '>= 1.12.9', '< 2' + s.add_runtime_dependency 'popper_js', '>= 1.14.3', '< 2' - s.add_runtime_dependency 'sass', '>= 3.5.2' - s.add_runtime_dependency 'autoprefixer-rails', '>= 6.0.3' + s.add_runtime_dependency 'sassc', '>= 1.12.1' + s.add_runtime_dependency 'autoprefixer-rails', '>= 9.1.0' # Testing dependencies s.add_development_dependency 'minitest', '~> 5.8.0' diff --git a/lib/bootstrap.rb b/lib/bootstrap.rb index 0a78bb1..d1cf51e 100644 --- a/lib/bootstrap.rb +++ b/lib/bootstrap.rb @@ -11,9 +11,10 @@ module Bootstrap register_hanami elsif sprockets? register_sprockets + elsif defined?(::Sass) && ::Sass.respond_to?(:load_paths) + # The deprecated `sass` gem: + ::Sass.load_paths << stylesheets_path end - - configure_sass end # Paths @@ -48,12 +49,6 @@ module Bootstrap private - def configure_sass - require 'sass' - - ::Sass.load_paths << stylesheets_path - end - def register_rails_engine require 'bootstrap/engine' end |