Elegant.Position

Position contains everything about position rendering.

Types


type Position

[]

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 =

Elegant.Surrounded.Surrounded Elegant.Helpers.Shared.SizeUnit

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


Position selection


static : Elegant.Position.Position

Position the element as static.



absolute : Modifiers.Modifiers Elegant.Position.Coordinates -> Elegant.Position.Position

Position the element as absolute, and requires coordinates.



relative : Modifiers.Modifiers Elegant.Position.Coordinates -> Elegant.Position.Position

Position the element as relative, and requires coordinates.



fixed : Modifiers.Modifiers Elegant.Position.Coordinates -> Elegant.Position.Position

Position the element as fixed, and requires coordinates.



sticky : Modifiers.Modifiers Elegant.Position.Coordinates -> Elegant.Position.Position

Position the element as sticky, and requires coordinates.


Position modifiers


top : Elegant.Helpers.Shared.SizeUnit -> Modifiers.Modifier Elegant.Position.Coordinates

Accepts a size, and modify the top position.



right : Elegant.Helpers.Shared.SizeUnit -> Modifiers.Modifier Elegant.Position.Coordinates

Accepts a size, and modify the right position.



bottom : Elegant.Helpers.Shared.SizeUnit -> Modifiers.Modifier Elegant.Position.Coordinates

Accepts a size, and modify the bottom position.



left : Elegant.Helpers.Shared.SizeUnit -> Modifiers.Modifier Elegant.Position.Coordinates

Accepts a size, and modify the left position.



horizontal : Elegant.Helpers.Shared.SizeUnit -> Modifiers.Modifier Elegant.Position.Coordinates

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



vertical : Elegant.Helpers.Shared.SizeUnit -> Modifiers.Modifier Elegant.Position.Coordinates

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



all : Elegant.Helpers.Shared.SizeUnit -> Modifiers.Modifier Elegant.Position.Coordinates

Accepts a size, and modify the four positions.


Compilation


positionToCouples : Elegant.Position.Position -> List.List ( String.String, String.String )

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