elm-athlete / athlete / Elegant.Border

Border contains everything about borders rendering.

Types


type alias Border =
{ color : Maybe Color
, thickness : Maybe Elegant.Helpers.Shared.SizeUnit
, style : Maybe BorderStyle 
}

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

Elegant.border
    [ Border.solid
    , Border.color Color.blue
    ]


type BorderStyle

Represents the possible styles of the border. It can be Solid or Dashed. They are created by solid and dashed.

Default border

default : Border

Generate an empty Border record, with every field equal to Nothing. You are free to use it as you wish, but it is instanciated automatically by Elegant.border.

Border modifiers

Appearance

thickness : Elegant.Helpers.Shared.SizeUnit -> Modifiers.Modifier Border

Set the thickness of the border.

none : Modifiers.Modifier Border

Set the border to none.

solid : Modifiers.Modifier Border

Set the border as solid.

dashed : Modifiers.Modifier Border

Set the border as dashed.

color : Color -> Modifiers.Modifier Border

Set the color of the border.

Sides

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

Accepts a list of border modifiers, and modify the top side of the border.

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

Accepts a list of border modifiers, and modify the bottom side of the border.

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

Accepts a list of border modifiers, and modify the left side of the border.

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

Accepts a list of border modifiers, and modify the right side of the border.

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

Accepts a list of border modifiers, and modify both the top and the bottom side of the border.

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

Accepts a list of border modifiers, and modify both the right and left side of the border.

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

Accepts a list of border modifiers, and modify the four sides of the border.

Compilation

borderToCouples : Elegant.Surrounded.Surrounded Border -> List ( String, String )

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

Sugar

full : Color -> Modifiers.Modifier (Elegant.Surrounded.Surrounded Border)

Accepts a color modifier