pub struct CssStyle { /* private fields */ }
Expand description
A type alias representing CSS style properties for HTML nodes in KaTeX rendering.
This HashMap
maps CSS property names (as strings) to their corresponding
values, enabling dynamic styling of mathematical expressions rendered as
HTML. It is used throughout the KaTeX rendering pipeline to apply visual
styles such as colors, fonts, spacing, and positioning to generated HTML
elements.
§LaTeX/KaTeX Context
In mathematical typesetting, CSS styles are crucial for controlling the visual appearance of rendered math, including font variants (e.g., italic for variables), display styles (inline vs. block), and layout adjustments. This type supports KaTeX’s approach to generating accessible and visually consistent math output.
§Cross-references
- Used in
TrustContext
for inline style validation. - See
Settings
for global styling options. - Related to
FontVariant
for font-specific styling.
Implementations§
Source§impl CssStyle
impl CssStyle
Sourcepub fn with_capacity(capacity: usize) -> Self
pub fn with_capacity(capacity: usize) -> Self
Creates one with given capacity
Sourcepub fn insert<T>(&mut self, property: CssProperty, value: T)
pub fn insert<T>(&mut self, property: CssProperty, value: T)
Inserts or updates a CSS property with the given value.
Sourcepub fn contains_key(&self, property: CssProperty) -> bool
pub fn contains_key(&self, property: CssProperty) -> bool
Checks if the style contains a specific CSS property.
Sourcepub fn get(&self, property: CssProperty) -> Option<&str>
pub fn get(&self, property: CssProperty) -> Option<&str>
Retrieves the value of a specific CSS property, if it exists.