pub struct CssLinkOptions { /* private fields */ }Expand description
Configures Link-mode CSS filenames and public hrefs.
Implementations§
Source§impl CssLinkOptions
impl CssLinkOptions
Sourcepub fn try_new(
file_name_template: String,
public_base: Option<String>,
) -> Result<Self>
pub fn try_new( file_name_template: String, public_base: Option<String>, ) -> Result<Self>
Create validated Link-mode CSS options.
§Errors
Returns ParserError::Css when the template contains unknown tokens,
unsafe path bytes, or an unsafe public base.
Sourcepub fn resolve(&self, tag_name: &str, css_content: &str) -> CssLinkHref
pub fn resolve(&self, tag_name: &str, css_content: &str) -> CssLinkHref
Resolve the local filename and public href for a component stylesheet.
Results are cached by component tag. A CssLinkOptions value should be
scoped to one build/component registry where each tag maps to exactly
one stylesheet.
Sourcepub fn resolve_chunk(&self, chunk_name: &str, css_content: &str) -> CssLinkHref
pub fn resolve_chunk(&self, chunk_name: &str, css_content: &str) -> CssLinkHref
Resolve the local filename and public href for a bundled CSS chunk.
Chunk names live in a build-owned namespace rather than the component registry, so this deliberately bypasses the per-tag cache: a chunk and a component that happen to share a name must never resolve to each other’s content hash.
Sourcepub fn file_name_template(&self) -> &str
pub fn file_name_template(&self) -> &str
File name template used for Link-mode CSS files.
Sourcepub fn public_base(&self) -> Option<&str>
pub fn public_base(&self) -> Option<&str>
Optional public base prepended to Link-mode CSS hrefs.