Containers vs. Elements
Layout Code describes both containers and elements.
A container is just that: it contains other things (containers and/or elements). An element is an atomic item that displays values about the parent object (character, document, etc.).
Containers
The primary signifier of a content block is the inclusion of a content
array. All other keys are optional (the layout is assumed to be "stacked
").
The items in the the content
array can be either element definitions or additional containers (which can also have their own child containers, ad infinitum).
Definition Format
align
values: 'right' or 'left'.blocklabel
Adds a block label element. Really needs to be in a "stacked" layout. Value will be passed through the localization parser.fluid
If true, try to fill the available space (vertical or horizontal), regardless of the parent layout.layout
mobilehide
If true, don't display this on small screens.mobilewrap
If false, don't automatically wrap the elements in this container on small screens.scale
Change the default size of the element (poorly supported)showlabel
If true, always display the label, even in contexts where it is usually hidden (e.g., collection rows)size
Defines the size of this container (see below for sizes)vertalign
Aligns content items in a block vertically. Values can betop
,bottom
, orcenter
wrap
Iffalse
ornone
, don't allow content to wrap. Iftrue
orwrap
, allow content to wrap (it may not).
Style Elements
Container blocks also support a small set of CSS element values. These should be used sparingly as support is primitive at this point in time (e.g., there's no text color changes, etc.).
style
Value is a single css class and is applied to the element.bgcolor
Sets the background color of the block. This should not be anything extreme.bordercolor
Adds a border of the given color (technically an inner box shadow, so it doesn't increase the size of the block).margin
Takes css margin values. Should be in rem.padding
Takes css margin values. Should be in rem.
Container Sizes
Container sizes are only applied to the container's width. Content can almost always grow verticall unbound, so constraining it doesn't make sense.
stretch
Grow this block to fill as wide as it can be.shrink
Make this block as small as it possibly can be.full
Size the block to 100% wide of the parent.threequarters
Size the block to 75% wide of the parent.twothirds
Size the block to 66% wide of the parent.big
Size the block to 66% wide of the parent.half
Size the block to 50% wide of the parent.third
Size the block to 33% wide of the parent.quarter
Size the block to 25% wide of the parent.
Container Layouts
stacked
Lays out content vertically, aligned to the top.spreadstacked
Lays out content vertically, spreading out items.row
Lays out content horizontally, aligned to the left by default.horizontal
Behaves exactly as "row"listrow
Behaves exactly as "row"bigboxrow
Behaves exactly as "row", with content spread apart, and assumes larger scaled content.
Elements
Addressing Parameters
Elements display data about the parent. Usually this an entity/character, but can also be a document or a group element.
Except for special elements (below), elemental data must be addressed. Data is either an attribute or a field on an item in a collection
item
Points to either an attribute or a Collection item. Ifcollection
is provided, then this is a Collection Item (see "collection" below), else it refers to the value of an attribute on the parent object (usually an entity). Thus a value ofstrength
will return the value of the attribute, "strength".collection
Indicates that this element points to a Collection. If present, the "item" value will address a specific item in the Collection by name. Sometimes - often - this is useless, as those Item ids are going to be randomly generated.field
Look at a specific field on a collection (Skills[Search][ranks])
Behavior Parameters
These parameters change the default behavior of an element or override its values.
editable
If false, don't allow editing for this element even if the user has permission to edit it.value
Don't bother withitem
or a collection, just use this value.calculation
Don't bother withitem
or a collection, just use the results of this calculation as the value.keyless
Don't give this element a key (prevents it from being updated automatically).classes
An array of css classes that can be applied to the element.
Element Display Parameters
These parameters affect how an Element is displayed. None are required. Not all are well-supported in all layouts ("labelposition") or are outright ignored ("labelless")
layout
Elements have MANY layouts (see below). Defaults tostatus_box
.type
Some elements (particularly pull-downs/enumerations, rich text elements, and booleans) require being defined as special type. See below.align
values: 'right' or 'left'.fluid
If true, try to fill the available space (vertical or horizontal), regardless of the parent layout.labelless
If true, don't display a label.labelposition
"interior" or "exterior"; default "exterior". Rarely useful.mobilehide
If true, don't display this on small screens.scale
Change the default size of the element (poorly supported)showlabel
If true, always display the label, even in contexts where it is usually hidden (e.g., collection rows)size
Defines the size of this container (see below for sizes)
Action Parameters
When present, these parameters indicate that the element is an actionable affordance (a button that can be clicked and something happens).
click
What to do when clicked:action
,valuetest
,rankedpool
.action
Upon being clicked, execute the action defined (see below).valuetest
Upon being clicked, execute the defined Action.rankedpool
Upon being clicked, roll the appropriate ranked pool.
action
Withclick
=action
, execute the named action (defined in the engine's actions.nonactionable
If true, even if there is an action available, do nothing if this is clicked.exits
Special Elements
Some elements are special and have slightly different behaviors.
text
Makes a text block, with the value given as the text.icon
Sets a simple icon.plus
,minus
, orequals
divider
Creates a vertical line to separate content.header
Makes a header element, with the value given as the text.
Element Layouts
layout
Element Sizes
Elements size themselves in more concrete measurements than percentages of their parent.
nano
1remmicro
2remtiny
4remsmall
6remmedium
8remlarge
10remhuge
12rembutton
15remgigantor
16remtyrannosaurus
20rem