matheus23/elm-figma-api/1.0.0

Figma.Layout

Layout constraints

= LeftConstraint
| RightConstraint
| LeftRightConstraint
| CenterHorizontalConstraint
| ScaleHorizontalConstraint

Horizontal constraint relative to containing frame.

= TopConstraint
| BottomConstraint
| TopBottomConstraint
| CenterVerticalConstraint
| ScaleVerticalConstraint

Vertical constraint relative to containing frame.

Grids

= ColumnsGrid Columns
| RowsGrid Rows
| SquareGrid Grid

Guides to align and place objects within a parent container.

type alias Columns =
{ width : Float
, isVisible : Bool
, color : Color
, gutter : Float
, margin : Float
, count : Int
, align : GridAlign
}

A vertical grid made of columns.

type alias Rows =
{ height : Float
, isVisible : Bool
, color : Color
, gutter : Float
, margin : Float
, count : Int
, align : GridAlign
}

A horizontal grid made of rows.

type alias Grid =
{ width : Float
, isVisible : Bool
, color : Color
}

A square grid.

= MinAlign
| CenterAlign
| MaxAlign

Positioning of grid within the parent container.

  • MinAlign: grid starts at the top (or left) of the container, filling the minimun space possible. The margin is applied before the grid.
  • CenterAlign: grid is center aligned. Margin value is ignored.
  • MaxAlign: grid stretches from the top (or left) to the bottom (or right) of the container, filling the maximun space possible. The margin is applied before and after the grid.