class Components::Assets::CSSAsset

Overview

CSS asset with processing capabilities

Defined in:

components/assets/css/css_asset.cr
components/assets/css_asset.cr

Constructors

Instance Method Summary

Instance methods inherited from class Components::Assets::Asset

add_dependency(asset_id : String) : Nil add_dependency, content : String content, content=(content : String) content=, content_type : String content_type, dependencies : Array(String) dependencies, fingerprint : String fingerprint, get_metadata(key : String) : String | Nil get_metadata, id : String id, metadata : Hash(String, String) metadata, modified? : Bool modified?, output_filename : String output_filename, process : String process, processed_content : String processed_content, reload : Nil reload, remove_dependency(asset_id : String) : Nil remove_dependency, set_metadata(key : String, value : String) : Nil set_metadata, source_path? : String | Nil source_path?, to_h : Hash(String, JSON::Any) to_h, updated_at : Time updated_at

Constructor methods inherited from class Components::Assets::Asset

new(source_path : String | Nil = nil, content : String = "") new

Constructor Detail

def self.merge(assets : Array(CSSAsset)) : CSSAsset #

Merge multiple CSS assets


[View source]
def self.new(id : String, config : Components::CSS::Config, mode : Symbol = :development) #

[View source]

Instance Method Detail

def autoprefixer : Bool #

[View source]
def autoprefixer=(autoprefixer : Bool) #

[View source]
def content_type : String #

Content type for CSS


[View source]
def export(output_path : String) #

Export the CSS to a file


[View source]
def extract_critical(selectors : Array(String)) : String #

Extract critical CSS for above-the-fold content


[View source]
def generate_source_map : String | Nil #

Generate source map


[View source]
def minify : Bool #

CSS-specific options


[View source]
def minify=(minify : Bool) #

CSS-specific options


[View source]
def path : String #

Path for this asset


[View source]
def process : String #

Process CSS content


[View source]
def source_map : Bool #

[View source]
def source_map=(source_map : Bool) #

[View source]
def to_style_tag : String #

Generate a style tag for this asset


[View source]