class Components::Assets::FontAsset

Overview

Describes a web font delivery strategy without forcing CDN or self-hosting. CDN assets emit stylesheet/preconnect tags; self-hosted assets emit preload tags plus @font-face CSS.

Defined in:

components/assets/font_asset.cr

Constructors

Instance Method Summary

Constructor Detail

def self.cdn(family : String, stylesheet_href : String) : FontAsset #

[View source]
def self.new(family : String, href : String, weight : String = "400", style : String = "normal", format : String = "woff2", display : String = "swap", strategy : Symbol = :self_hosted, preload : Bool = true) #

[View source]
def self.self_hosted(family : String, href : String, weight : String = "400", style : String = "normal", format : String = "woff2", display : String = "swap", preload : Bool = true) : FontAsset #

[View source]

Instance Method Detail

def display : String #

[View source]
def family : String #

[View source]
def font_face_css : String #

[View source]
def format : String #

[View source]
def href : String #

[View source]
def link_tags : String #

[View source]
def preload : Bool #

[View source]
def strategy : Symbol #

[View source]
def style : String #

[View source]
def weight : String #

[View source]