uncover-co / elm-theme-studio

A companion application to help you define and test your elm-theme themes

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

elm-theme-studio

A tool to easily test and validate your elm-theme based themes.

import Html
import Theme
import Theme.Studio


type Model =
    { theme : Theme.Theme
    , themeStudioModel : Theme.Studio.Model
    }


init : Model
init =
    { theme = Theme.lightTheme
    , themeStudioModel = Theme.Studio.init Theme.lightTheme
    }


type Msg
    = ThemeStudioMsg Theme.Studio.Msg


update : Msg -> Model -> Model
update msg model =
    case msg of
        ThemeStudioMsg themeStudioMsg ->
	        let
                themeStudioModel : Theme.Studio.Model
                themeStudioModel =
                    Theme.Studio.update themeStudioMsg model.themeStudioModel

                theme : Theme.Theme
                theme =
                    Theme.Studio.toTheme themeStudioModel
            in
            { model
                | theme = theme
                , themeStudioModel = themeStudioModel
                }


view : Model -> Html.Html Msg
view model =
    Theme.Studio.view model.themeStudioModel
        |> Html.map ThemeStudioMsg

About

A companion application to help you define and test your elm-theme themes

License:Mozilla Public License 2.0


Languages

Language:Elm 97.0%Language:HTML 3.0%