class Mako::SassRenderer

Attributes

template[R]

Public Class Methods

new(args) click to toggle source
# File lib/mako/sass_renderer.rb, line 9
def initialize(args)
  @template = args.fetch(:template, File.expand_path(File.join('themes', "#{Mako.config.theme}.scss"), Dir.pwd))
end

Public Instance Methods

file_path() click to toggle source

Default file name for rendererd file.

@return [String]

# File lib/mako/sass_renderer.rb, line 26
def file_path
  'main.css'
end
render() click to toggle source

Wrapper for SassC::Engine. Creates new SassC::Engine instance with main Sass file and renders it.

@return [String]

# File lib/mako/sass_renderer.rb, line 17
def render
  SassC::Engine.new(load_resource(template), syntax: :scss,
                                             load_paths: [File.expand_path('themes/', Dir.pwd)],
                                             style: :compressed).render
end