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

Add load_paths to Sass Engine #48

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
9 changes: 6 additions & 3 deletions lib/twee2/story_file.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ class StoryFileNotFoundException < Exception; end

class StoryFile
attr_accessor :passages
attr_reader :child_story_files
attr_reader :child_story_files, :filename

HAML_OPTIONS = {
remove_whitespace: true
Expand All @@ -22,6 +22,7 @@ class StoryFile
# Loads the StoryFile with the given name
def initialize(filename)
raise(StoryFileNotFoundException) if !File::exists?(filename)
@filename = filename
@passages, current_passage = {}, nil
@child_story_files = []

Expand Down Expand Up @@ -132,10 +133,12 @@ def run_preprocessors
end
# SASS / SCSS
if @passages[k][:tags].include? 'sass'
@passages[k][:content] = Sass::Engine.new(@passages[k][:content], :syntax => :sass).render
opts = { :syntax => :sass, :load_paths => [ File.dirname(@filename) ] }
@passages[k][:content] = Sass::Engine.new(@passages[k][:content], opts).render
end
if @passages[k][:tags].include? 'scss'
@passages[k][:content] = Sass::Engine.new(@passages[k][:content], :syntax => :scss).render
opts = { :syntax => :scss, :load_paths => [ File.dirname(@filename) ] }
@passages[k][:content] = Sass::Engine.new(@passages[k][:content], opts).render
end
end
end
Expand Down