-
Notifications
You must be signed in to change notification settings - Fork 10
Closed
Description
Before version 1.2.0, we can use sass-embedded with Tilt by using some workaround such as follows:
module Tilt
class SassTemplate < Template
self.default_mime_type = "text/css"
@@load_paths = []
def self.load_paths
@@load_paths
end
begin
require "sass-embedded"
rescue LoadError => err
raise err
end
def prepare
@render_result = Sass.compile_string(data, **sass_options)
rescue => e
puts "ERROR"
p e.sass_message, e.sass_stack, e.span
end
def evaluate(scope, locals, &block)
@output ||= @render_result.css
end
def allows_script?
false
end
private
def sass_options
# options.merge(filename: eval_file, line: line, syntax: :indented)
options.merge(load_paths: @@load_paths, syntax: :indented)#load_paths: [])
end
end
class ScssTemplate < SassTemplate
self.default_mime_type = "text/css"
def sass_options
options.merge(syntax: :scss)#load_paths: [])
end
end
end
The above code overwrites the original SassTemplate and ScssTemplate of Tilt.
However, the following exception occurs at here after version 1.2.0.
LoadError: cannot load such file -- sassc
How can I use sass-embedded with Tilt?
Metadata
Metadata
Assignees
Labels
No labels