Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Switch to sass-embedded #466

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions asciidoctor-epub3.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,5 @@ Gem::Specification.new do |s|
s.add_runtime_dependency 'gepub', '~> 1.0.0'
s.add_runtime_dependency 'mime-types', '~> 3.0'

# TODO: switch to 'sass-embedded' when we drop Ruby 2.5 support
s.add_runtime_dependency 'sass'
s.add_runtime_dependency 'sass-embedded', '~> 1.58'
end
7 changes: 2 additions & 5 deletions lib/asciidoctor-epub3/converter.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

require 'mime/types'
require 'open3'
require 'sass'
require 'sass-embedded'
require_relative 'font_icon_map'

module Asciidoctor
Expand Down Expand Up @@ -1698,10 +1698,7 @@ def select_fonts(font_css, scripts = 'latin')
end

def load_css_file(filename)
template = File.read filename
load_paths = [File.dirname(filename)]
sass_engine = Sass::Engine.new template, syntax: :scss, cache: false, load_paths: load_paths, style: :compressed
sass_engine.render
Sass.compile(filename, style: :compressed).css
end

def build_epubcheck_command
Expand Down