EngageSoftware/elm-engage-common/8.1.0

NOTE: the latest version is 8.2.10

Engage.Theme

Basic Theme types

Types

type alias ColorPalette =
{ base : Color
, contrast : Color
, tertiary : Color
}

A color palette

type alias Decoration a =
{ a | border : Border }

A decoration type

type alias DecorationOnly =
Decoration {}

A decoration only type

type alias LabelTypography a =
{ a
| labelFontFamily : FontFamily
, labelFontSize :
{ base : Size
, small : Relative
}
}

A label typography type

type alias LabelTypographyOnly =
LabelTypography {}

A label typography only type

type alias Palette =
{ buttonPrimary : ColorPalette
, buttonPrimaryHover : ColorPalette
, buttonStandard : ColorPalette
, buttonStandardHover : ColorPalette
, buttonDivert : ColorPalette
, buttonDivertHover : ColorPalette
, input : ColorPalette
, dropdown : ColorPalette
, error : ColorPalette
, warning : ColorPalette
, confirmation : ColorPalette
, info : ColorPalette
, wizardHeader : ColorPalette
}

A theme palatte

type alias Spacing =
ThemeData
SpacingDataOnly
(SpacingData WithLabelOnly)
(SpacingData WithLabelOnly)
SpacingDataOnly
SpacingDataOnly

A spacing type

type alias SpacingData modifier =
{ modifier
| padding :
{ base : Padding
, small : Relative
}
, margin :
{ base : Margin
, small : Relative
}
}

A spacing data type

type alias Style =
ThemeData
(Typography (LabelTypography DecorationOnly))
(Typography (LabelTypography DecorationOnly))
(Typography (LabelTypography DecorationOnly))
(Typography DecorationOnly)
(Typography DecorationOnly)

A style type

type Theme
= Light
| Dark
| ISMA
| None

A theme

type alias ThemeData button input dropdown wizard wizardHeader =
{ button : button
, input : input
, dropdown : dropdown
, wizard : wizard
, wizardHeader : wizardHeader
}

A theme data type

type alias Typography a =
{ a
| fontFamily : FontFamily
, fontSize :
{ base : Size
, small : Relative
}
}

A typography type

type alias TypographyOnly =
Typography {}

A typography only type

type alias WithLabel a =
{ a
| labelMargin :
{ base : Margin
, small : Relative
}
, labelPadding :
{ base : Padding
, small : Relative
}
}

A with label type

type alias WithLabelOnly =
WithLabel {}

A with label only type

Helpers

fromString : Theme -> String -> Theme

Get a theme from a string

Get a dropdown item for the theme

toString : Theme -> String

Get the string value of a theme