plinth/browser/shadow

Types

pub type Mode {
  Open
  Closed
}

Constructors

  • Open
  • Closed
pub type ShadowRoot

Values

pub fn append_child(
  root: ShadowRoot,
  element: element.Element,
) -> Nil
pub fn attach_shadow(
  element: element.Element,
  mode: Mode,
) -> ShadowRoot
pub fn query_selector(
  shadow_root: ShadowRoot,
  selector: String,
) -> Result(element.Element, Nil)

Returns the first element that matches the given selector in the given shadow root, if any.

pub fn query_selector_all(
  shadow_root: ShadowRoot,
  selector: String,
) -> array.Array(element.Element)

Returns all elements that match the given selector in the given shadow root.

pub fn shadow_root(
  element: element.Element,
) -> Result(ShadowRoot, Nil)

Returns the shadow root attached to the given element, if any.

Search Document