elm-athlete/athlete/6.0.2

NOTE: the latest version is 7.0.0

Elegant.Position

Position contains everything about position rendering.

Types

Represents a position, whih can be static, absolute, relative, fixed or sticky. You don't need to bother about it, since it is generated by static, absolute, relative, fixed or sticky.

type alias Coordinates =
Surrounded SizeUnit

Represents the coordinates of the element. There is top, bottom, left and right.

Position selection

Position the element as static.

absolute : Modifiers Coordinates -> Position

Position the element as absolute, and requires coordinates.

relative : Modifiers Coordinates -> Position

Position the element as relative, and requires coordinates.

fixed : Modifiers Coordinates -> Position

Position the element as fixed, and requires coordinates.

sticky : Modifiers Coordinates -> Position

Position the element as sticky, and requires coordinates.

Position modifiers

top : SizeUnit -> Modifier Coordinates

Accepts a size, and modify the top position.

bottom : SizeUnit -> Modifier Coordinates

Accepts a size, and modify the bottom position.

left : SizeUnit -> Modifier Coordinates

Accepts a size, and modify the left position.

horizontal : SizeUnit -> Modifier Coordinates

Accepts a size, and modify both the top and bottom positions.

vertical : SizeUnit -> Modifier Coordinates

Accepts a size, and modify both the left and right positions.

all : SizeUnit -> Modifier Coordinates

Accepts a size, and modify the four positions.

Compilation

positionToCouples : Position -> List ( String, String )

Compiles a Position to the corresponding CSS list of tuples. Compiles only styles which are defined, ignoring Nothing fields.