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 bg_color(node: Node, v: String) -> Node
pub external fn bg_img(node: Node, v: String) -> Node
pub external fn border(node: Node, v: String) -> Node
pub external fn border_color(node: Node, v: String) -> Node
pub external fn class(node: Node, v: String) -> Node
pub external fn color(node: Node, v: String) -> Node
pub external fn cursor(node: Node, v: String) -> Node
pub external fn display(node: Node, v: String) -> Node
pub external fn flex(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_grow(node: Node, v: String) -> Node
pub external fn flex_shrink(node: Node, v: String) -> Node
pub external fn flex_wrap(node: Node, v: String) -> Node
pub external fn font(node: Node, v: String) -> Node
pub external fn font_family(node: Node, v: String) -> Node
pub external fn gap(node: Node, v: String) -> Node
pub external fn grid(node: Node, v: String) -> Node
pub external fn grid_area(node: Node, v: String) -> Node
pub external fn height(node: Node, v: String) -> Node
pub external fn margin(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(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 position(node: Node, v: String) -> Node
pub external fn radius(node: Node, v: String) -> Node
pub external fn rotate(node: Node, v: String) -> Node
pub external fn size(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
pub external fn weight(node: Node, v: String) -> Node
pub external fn width(node: Node, v: String) -> Node
pub external fn z_index(node: Node, v: String) -> Node
Search Document