Skip to content

Detailed Usage

Unlocked edited this page Sep 15, 2020 · 2 revisions

Definitions

  • A "structured" value is a <pair> or <list> element, or an S-expression.
  • An "unstructured" value is a one-word string, a double-quoted string, an <empty> element, or a <box> element.

<box-and-pointer>

The stylesheet attribute may be used to specify a CSS file to inject into the shadow root of the element.

At the top level of a <box-and-pointer> element, only structured values may be used. By default, the first top-level object will be considered the root pair. However, the origin attribute may be placed on any top-level <pair> or <list> element to make it the root.

<pair>

The <pair> element can contain two structured or unstructured values, where the first is the head and the second is the tail. If one or neither of those values are included, they are replaced with an empty list. Any number of additional structured values may be included after those two, for if you want to introduce named pairs or lists. The name attribute may be included to name the pair.

<list>

The <list> element can contain any number of structured or unstructured values, which will be combined into a linked list structure. The explicit-tail attribute can be used to make the last element become the tail of the last pair, replacing the empty list. The name attribute may be included to name the first pair in the linked list.

<box>

The <box> element can either have a ref attribute OR it can contain a single structured or unstructured value, excluding a <box> element. If it has the ref attribute, its contents are ignored and it becomes a pointer to the pair with the corresponding name attribute. Otherwise, the <box> element acts like its contents. If no name corresponds with the value of the ref attribute, the box just acts like <empty>. The value attribute can be used to fill the box with an unquoted string, but this is rarely used. The <box> element must use a closing tag, even if it has no contents.

<empty>

The <empty> element acts as an empty list. It must use a closing tag even though it has no contents.

Clone this wiki locally