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]

定义
from0.14.0起可用
Returns a direction from a starting point.
This function does the opposite of direction.start.
展开示例
#direction.from(left) \
#direction.from(right) \
#direction.from(top) \
#direction.from(bottom)

side
The starting point for the direction.
This cannot be start or end.
to0.14.0起可用
Returns a direction from an end point.
This function does the opposite of direction.end.
展开示例
#direction.to(left) \
#direction.to(right) \
#direction.to(top) \
#direction.to(bottom)

side
The end point for the direction.
This cannot be start or end.
axis0.7.0起可用
The axis this direction belongs to, either "horizontal" or "vertical".
展开示例
#ltr.axis() \
#ttb.axis()

sign0.14.0起可用
The corresponding sign, for use in calculations.
This is the sign of the vector going this direction along the corresponding axis.
展开示例
#ltr.sign() \
#rtl.sign() \
#ttb.sign() \
#btt.sign()

start0.7.0起可用
The starting point of this direction.
This function does the opposite of direction.from.
展开示例
#ltr.start() \
#rtl.start() \
#ttb.start() \
#btt.start()

end0.7.0起可用
The end point of this direction.
This function does the opposite of direction.to.
展开示例
#ltr.end() \
#rtl.end() \
#ttb.end() \
#btt.end()

inv自始可用
The inverse (opposite) direction.
展开示例
#ltr.inv() \
#rtl.inv() \
#ttb.inv() \
#btt.inv()
