Direction

You're browsing the documentation for v3

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

Params

prop

A property name to translate.

axisOnly

Optional. If true, returns the same property for LTR and RTL.

Return

A resolved property name.


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.

Params

value

A value to orient.

Return

An oriented value.