Elegant.Margin

Margin contains everything about margins rendering.

Types


type alias Margin =

Either.Either Elegant.Helpers.Shared.SizeUnit Elegant.Helpers.Shared.Auto

The Margin record contains everything about one margin side. You probably won't use it as is, but instead using Elegant.margin which automatically generate an empty Margin record. You can then use modifiers. I.E.

Elegant.margin
    [ Margin.top <| Margin.width (px 30)
    , Margin.vertical Margin.auto
    ]

Default margin


default : Elegant.Margin.Margin

Generate an empty Margin record, equal to auto. You are free to use it as you wish, but it is instanciated automatically by Elegant.margin.


Margin setters


auto : Elegant.Margin.Margin -> Elegant.Margin.Margin

Set the margin value to auto.



width : Elegant.Helpers.Shared.SizeUnit -> Elegant.Margin.Margin -> Elegant.Margin.Margin

Set the margin value to the desired value.


Margin selectors


top : Modifiers.Modifier Elegant.Margin.Margin -> Modifiers.Modifier (Elegant.Surrounded.Surrounded Elegant.Margin.Margin)

Accepts a margin modifier, and modify the top side of the margin.



right : Modifiers.Modifier Elegant.Margin.Margin -> Modifiers.Modifier (Elegant.Surrounded.Surrounded Elegant.Margin.Margin)

Accepts a margin modifier, and modify the right side of the margin.



bottom : Modifiers.Modifier Elegant.Margin.Margin -> Modifiers.Modifier (Elegant.Surrounded.Surrounded Elegant.Margin.Margin)

Accepts a margin modifier, and modify the bottom side of the margin.



left : Modifiers.Modifier Elegant.Margin.Margin -> Modifiers.Modifier (Elegant.Surrounded.Surrounded Elegant.Margin.Margin)

Accepts a margin modifier, and modify the left side of the margin.



horizontal : Modifiers.Modifier Elegant.Margin.Margin -> Modifiers.Modifier (Elegant.Surrounded.Surrounded Elegant.Margin.Margin)

Accepts a margin modifier, and modify both the top and the bottom side of the margin.



vertical : Modifiers.Modifier Elegant.Margin.Margin -> Modifiers.Modifier (Elegant.Surrounded.Surrounded Elegant.Margin.Margin)

Accepts a margin modifier, and modify both the right and left side of the margin.



all : Modifiers.Modifier Elegant.Margin.Margin -> Modifiers.Modifier (Elegant.Surrounded.Surrounded Elegant.Margin.Margin)

Accepts a margin modifier, and modify the four sides of the margin.


Compilation


marginToCouples : Elegant.Surrounded.Surrounded Elegant.Margin.Margin -> List.List ( String.String, String.String )

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