ElementorexCms.Id (ElementorexCms v0.1.0)

Copy Markdown View Source

Identifiers of document nodes.

Ids are short random strings ("Kq2b7Rt9Lm") that stay stable for the life of a node: the CSS of a node is scoped to its id ([data-ex-id="Kq2b7Rt9Lm"]) and the editor selects and moves nodes by id.

Summary

Functions

A new random id.

Whether id can be used as a node id: 1 to 40 letters, digits, - or _. Anything else could break out of the attribute selectors the CSS uses.

Functions

generate()

@spec generate() :: String.t()

A new random id.

valid?(id)

@spec valid?(term()) :: boolean()

Whether id can be used as a node id: 1 to 40 letters, digits, - or _. Anything else could break out of the attribute selectors the CSS uses.