elm-css icon indicating copy to clipboard operation
elm-css copied to clipboard

Cannot use elm-css with lamdera

Open hiovi opened this issue 4 years ago • 1 comments

I'm quite new to elm. I was wondering if I could use elm-css with lamdera. Has anyone tried it?

hiovi avatar Sep 02 '21 18:09 hiovi

This should work fine.

See attached example for how to setup elm-css with lamdera.

First install elm-css through lamdera.

lamdera install rtfeldman/elm-css

Then modify your Frontend.elm file (as of Lamdera 1.0)

-- Additional Imports
import Css
import Css.Global
import Html.Styled as Html exposing (..)
import Html.Styled.Attributes as Attr

-- Remove existing Html imports

-- snip

-- snip

view : Model -> Browser.Document FrontendMsg
view model =
    { title = ""
    , body =
        [ Html.toUnstyled <|
            Html.div [ Attr.css [ Css.backgroundColor (Css.rgb 100 255 100) ] ]
                [  text "Hello World!"
                ]
        ]
    }

Strepto avatar Oct 28 '21 19:10 Strepto