Skip to main content

Stylesheet

This class represents a CSS stylesheet media asset, specifically designed to generate HTML link elements. It extends the base media asset functionality by utilizing a predefined template to link external style resources with customizable attributes.

Attributes

AttributeTypeDescription
element_templatestring = < link href="{path}"{attributes} >The HTML string template used to render the stylesheet link tag, containing placeholders for the file path and additional attributes.

Constructor

Signature

def Stylesheet(
href: string,
**attributes: dict
) - > null

Parameters

NameTypeDescription
hrefstringThe URL or path to the stylesheet file.
**attributesdictAdditional keyword arguments to be applied as HTML attributes to the link element.

Signature

def Stylesheet(
href: string,
**attributes: dict
) - > null

Parameters

NameTypeDescription
hrefstringThe URL or file path to the external CSS stylesheet resource
**attributesdictAdditional HTML attributes to be included in the link element, such as media, integrity, or crossorigin