pub struct CssClass { /* private fields */ }Expand description
Represents a CSS class with a name and its style declarations.
Created by the class! macro and used in html! via the class: attribute.
When the renderer encounters a CssClass, it injects the styles into the
DOM’s <style> element on first use and applies the class name to the element.
Implementations§
Source§impl CssClass
Implementation of CssClass construction and style injection.
impl CssClass
Implementation of CssClass construction and style injection.
Sourcepub fn new(name: String, style: String) -> Self
pub fn new(name: String, style: String) -> Self
Creates a new CSS class with the given name and style declarations.
Sourcepub fn inject_style(&self)
pub fn inject_style(&self)
Injects this class’s styles into the DOM if not already present.
Creates a <style> element with id euv-css-injected on first call,
then appends the class rule. Subsequent calls for the same class name
are no-ops. On first creation, also injects global CSS keyframes
required by built-in animations.
Trait Implementations§
Source§impl IntoReactiveValue for &'static CssClass
Converts a reference to a CSS class into an attribute value by cloning.
impl IntoReactiveValue for &'static CssClass
Converts a reference to a CSS class into an attribute value by cloning.
Source§fn into_reactive_value(self) -> AttributeValue
fn into_reactive_value(self) -> AttributeValue
AttributeValue, wrapping signals
for reactive updates or converting static values to text.Source§impl IntoReactiveValue for CssClass
Converts a CSS class reference into an attribute value.
impl IntoReactiveValue for CssClass
Converts a CSS class reference into an attribute value.
Source§fn into_reactive_value(self) -> AttributeValue
fn into_reactive_value(self) -> AttributeValue
AttributeValue, wrapping signals
for reactive updates or converting static values to text.