Class: Prez::Assets::Stylesheet

Inherits:
Tagged
  • Object
show all
Defined in:
lib/prez/assets.rb

Instance Attribute Summary

Attributes inherited from Tagged

#contents, #file, #name, #options

Instance Method Summary collapse

Methods inherited from Tagged

#compiled_contents, #dev?, #initialize, #minified_contents, #self_closing?, #to_tag

Constructor Details

This class inherits a constructor from Prez::Assets::Tagged

Instance Method Details

#closeObject



149
150
151
# File 'lib/prez/assets.rb', line 149

def close
  %{</style>}
end

#compile(contents) ⇒ Object



153
154
155
156
157
158
# File 'lib/prez/assets.rb', line 153

def compile(contents)
  Sass::Engine.new(contents,
                   syntax: :scss,
                   style: :expanded,
                   load_paths: [File.dirname(file)]).render
end

#extensionObject



141
142
143
# File 'lib/prez/assets.rb', line 141

def extension
  "css"
end

#minify(contents) ⇒ Object



160
161
162
163
164
165
# File 'lib/prez/assets.rb', line 160

def minify(contents)
  Sass::Engine.new(contents,
                   syntax: :scss,
                   style: :compressed,
                   load_paths: [File.dirname(file)]).render
end

#openObject



145
146
147
# File 'lib/prez/assets.rb', line 145

def open
  %{<style type="text/css">}
end