Overview

The Direction component resolves the difference among directions.

Methods

resolve()

resolve( prop: string, axisOnly?: boolean ): string

Resolves the provided property name according to the current direction. For example, this resolves marginRight to marginBottom in the TTB mode, and marginLeft in the RTL mode.

Here is a list of acceptable names:

  • marginRight
  • width
  • autoWidth
  • fixedWidth
  • paddingLeft
  • paddingRight
  • left
  • right
  • left
  • x
  • X
  • Y
  • ArrowLeft
  • ArrowRight

orient()

orient( value: number ): number

Orients the value towards the current direction. For example, orient( 100 ) returns -100 in the LTR mode, and 100 in the RTL mode.