uncover-co/elm-theme-spec/7.1.0

NOTE: the latest version is 8.0.1

ThemeSpec

ThemeSpec is a theme specification that can be used across a variety of projects to quickly theme them based on CSS variables. Themes are scoped and multiple can be used at the same time in an application. ThemeSpec is fully compatible with darkmode and any theme can have dark variants.

theme : ThemeSpec -> Theme
themeSpec : ThemeSpecData -> List ( String, String ) -> ThemeSpec
type alias ThemeSpecData =
{ fonts :
{ title : String
, text : String
, code : String
}
, colors :
{ background : ThemeSpecColor
, baseline : ThemeSpecColor
, primary : ThemeSpecColor
, secondary : ThemeSpecColor
, success : ThemeSpecColor
, warning : ThemeSpecColor
, danger : ThemeSpecColor
}
}
type alias ThemeSpecColor =
{ base : Color
, light : Color
, contrast : Color
}

Theme Sample

sample : Html msg

Renders an element that showcases all the current theme's colors and settings.

Theme Variables

fontTitle : String

var(--tmspc-font-title)

fontText : String

var(--tmspc-font-text)

fontCode : String

var(--tmspc-font-code)

background : ThemeSpecColorVars
baseline : ThemeSpecColorVars
primary : ThemeSpecColorVars
secondary : ThemeSpecColorVars
success : ThemeSpecColorVars
warning : ThemeSpecColorVars
danger : ThemeSpecColorVars
type alias ThemeSpecColorVars =
{ base : String
, baseChannels : String
, light : String
, lightChannels : String
, contrast : String
, contrastChannels : String
}