glare/property
Property functions are used to add properties to an element such as styling or classes. Standard usage unless specified is as follows
h2([text("hello world")])
|> font("Lexend")
|> PROPERTY_FUNCTION("STRINGED VALUE")
Functions
pub external fn attr(node: Node, k: String, v: String) -> Node
Add an attribute on a node
html([
p([text("שלום")])
|> attr("dir", "rtl")
])
|> attr("lang", "he")
pub external fn background(node: Node, v: String) -> Node
pub external fn border_color(node: Node, v: String) -> Node
pub external fn flex_basis(node: Node, v: String) -> Node
pub external fn flex_direction(node: Node, v: String) -> Node
pub external fn flex_shrink(node: Node, v: String) -> Node
pub external fn font_family(node: Node, v: String) -> Node
pub external fn margin_bottom(node: Node, v: String) -> Node
pub external fn margin_left(node: Node, v: String) -> Node
pub external fn margin_right(node: Node, v: String) -> Node
pub external fn margin_top(node: Node, v: String) -> Node
pub external fn padding_bottom(node: Node, v: String) -> Node
pub external fn padding_left(node: Node, v: String) -> Node
pub external fn padding_right(node: Node, v: String) -> Node
pub external fn padding_top(node: Node, v: String) -> Node
pub external fn style(node: Node, k: String, v: String) -> Node
Add custom styling on a node
div([])
|> style("border", "1px solid black")
|> style("borderRadius", "50%")
|> style("backgroundColor", "#ffaff3")
pub external fn text_align(node: Node, v: String) -> Node
pub external fn text_overflow(node: Node, v: String) -> Node
pub external fn text_shadow(node: Node, v: String) -> Node