class
Components::Assets::CSSAsset
- Components::Assets::CSSAsset
- Components::Assets::Asset
- Reference
- Object
Overview
CSS asset with processing capabilities
Defined in:
components/assets/css/css_asset.crcomponents/assets/css_asset.cr
Constructors
-
.merge(assets : Array(CSSAsset)) : CSSAsset
Merge multiple CSS assets
- .new(id : String, config : Components::CSS::Config, mode : Symbol = :development)
Instance Method Summary
- #autoprefixer : Bool
- #autoprefixer=(autoprefixer : Bool)
-
#content_type : String
Content type for CSS
-
#export(output_path : String)
Export the CSS to a file
-
#extract_critical(selectors : Array(String)) : String
Extract critical CSS for above-the-fold content
-
#generate_source_map : String | Nil
Generate source map
-
#minify : Bool
CSS-specific options
-
#minify=(minify : Bool)
CSS-specific options
-
#path : String
Path for this asset
-
#process : String
Process CSS content
- #source_map : Bool
- #source_map=(source_map : Bool)
-
#to_style_tag : String
Generate a style tag for this asset
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
Instance Method Detail
def extract_critical(selectors : Array(String)) : String
#
Extract critical CSS for above-the-fold content