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 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 fn background(node: Node, v: String) -> Node
pub fn border_color(node: Node, v: String) -> Node
pub fn flex_basis(node: Node, v: String) -> Node
pub fn flex_direction(node: Node, v: String) -> Node
pub fn flex_shrink(node: Node, v: String) -> Node
pub fn font_family(node: Node, v: String) -> Node
pub fn margin_bottom(node: Node, v: String) -> Node
pub fn margin_left(node: Node, v: String) -> Node
pub fn margin_right(node: Node, v: String) -> Node
pub fn margin_top(node: Node, v: String) -> Node
pub fn padding_bottom(node: Node, v: String) -> Node
pub fn padding_left(node: Node, v: String) -> Node
pub fn padding_right(node: Node, v: String) -> Node
pub fn padding_top(node: Node, v: String) -> Node
pub 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 fn text_align(node: Node, v: String) -> Node
pub fn text_overflow(node: Node, v: String) -> Node
pub fn text_shadow(node: Node, v: String) -> Node