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



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

def close
  %{</style>}
end

#compile(contents) ⇒ Object



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

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

#extensionObject



137
138
139
# File 'lib/prez/assets.rb', line 137

def extension
  "css"
end

#minify(contents) ⇒ Object



156
157
158
159
160
161
# File 'lib/prez/assets.rb', line 156

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

#openObject



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

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