direction
The four directions into which content can be laid out.
Possible values are:
ltr: Left to right.rtl: Right to left.ttb: Top to bottom.btt: Bottom to top.
These values are available globally and also in the direction type's scope, so you can write either of the following two:
#stack(dir: rtl)[A][B][C]
#stack(dir: direction.rtl)[A][B][C]

DefinitionsDefinitionsThese functions and types can have related definitions. To access a definition, specify the name of the function or type, followed by the definition name separated by a period.
Definitions
These functions and types can have related definitions. To access a definition, specify the name of the function or type, followed by the definition name separated by a period.
from
fromReturns a direction from a starting point.
Show example
#direction.from(left) \
#direction.from(right) \
#direction.from(top) \
#direction.from(bottom)

direction.from()->sideRequiredRequiredRequired parameters must be specified when calling the function.PositionalPositionalPositional parameters can be set by specifying them in order, omitting the parameter name.
sideRequired
Required
Required parameters must be specified when calling the function.
Positional
Positional
Positional parameters can be set by specifying them in order, omitting the parameter name.
to
toReturns a direction from an end point.
Show example
#direction.to(left) \
#direction.to(right) \
#direction.to(top) \
#direction.to(bottom)

direction.to()->sideRequiredRequiredRequired parameters must be specified when calling the function.PositionalPositionalPositional parameters can be set by specifying them in order, omitting the parameter name.
sideRequired
Required
Required parameters must be specified when calling the function.
Positional
Positional
Positional parameters can be set by specifying them in order, omitting the parameter name.
axis
axisThe axis this direction belongs to, either "horizontal" or
"vertical".
Show example
#ltr.axis() \
#ttb.axis()

self.axis()->sign
signThe corresponding sign, for use in calculations.
Show example
#ltr.sign() \
#rtl.sign() \
#ttb.sign() \
#btt.sign()

self.sign()->start
startThe start point of this direction, as an alignment.
Show example
#ltr.start() \
#rtl.start() \
#ttb.start() \
#btt.start()

self.start()->end
endThe end point of this direction, as an alignment.
Show example
#ltr.end() \
#rtl.end() \
#ttb.end() \
#btt.end()

self.end()->inv
invThe inverse direction.
Show example
#ltr.inv() \
#rtl.inv() \
#ttb.inv() \
#btt.inv()

self.inv()->