Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot use elm-css with lamdera #540

Open
hiovi opened this issue Sep 2, 2021 · 1 comment
Open

Cannot use elm-css with lamdera #540

hiovi opened this issue Sep 2, 2021 · 1 comment

Comments

@hiovi
Copy link

hiovi commented Sep 2, 2021

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

@Strepto
Copy link

Strepto commented Oct 28, 2021

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!"
                ]
        ]
    }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants