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