class Fuse::Document::Asset::StyleSheet

Constants

EMBED_WITH
JOIN_WITH
MEDIA_PATTERN

Public Instance Methods

compress() click to toggle source
# File lib/fuse/document/asset/style_sheet.rb, line 35
def compress
  original = raw
  compressed = ::Sass.compile original, style: :compressed
  Fuse.log "SASS: Compressed #{path} from #{original.bytesize} bytes to #{compressed.bytesize} bytes", :success
  compressed
end
conditional() click to toggle source
# File lib/fuse/document/asset/style_sheet.rb, line 27
def conditional
  @conditional ||= Conditional.new self
end
conditional_signature() click to toggle source
# File lib/fuse/document/asset/style_sheet.rb, line 31
def conditional_signature
  conditional.signature
end
media() click to toggle source
# File lib/fuse/document/asset/style_sheet.rb, line 23
def media
  @media ||= (match = MEDIA_PATTERN.match(path)) && match[1].split(/,\s*/).sort.join(', ')
end
reference_with() click to toggle source
# File lib/fuse/document/asset/style_sheet.rb, line 12
def reference_with
  {
      tag_name: 'link',
      attributes: {
          rel: 'stylesheet',
          href: relative_path,
          media: media
      }
  }
end
type() click to toggle source
# File lib/fuse/document/asset/style_sheet.rb, line 42
def type; 'text/css' end