on master help sign in
Merge pull request #463 from rashadg1030/add-css-example

Introduce CSS file to skeleton project

commit0665ab20a1ff1d8fb3ab36851af7cdbc6776a15c authorElliot Cameron <3noch@users.noreply.github.com> dateThu 2 Jan 2020, 18:42 (7 years ago) parent4cb29571f7c481
2 files changed+12−3
skeleton/frontend/src/Frontend.hs+9−3 skeleton/static/main.css+3
skeleton/frontend/src/Frontend.hs+9−3
@@ -1,24 +1,30 @@
11{-# LANGUAGE DataKinds #-}
22{-# LANGUAGE OverloadedStrings #-}
33{-# LANGUAGE TypeApplications #-}
4+
45module Frontend where
56
67import qualified Data.Text as T
78import qualified Data.Text.Encoding as T
9+
810import Obelisk.Frontend
911import Obelisk.Configs
1012import Obelisk.Route
13+import Obelisk.Generated.Static
14+
1115import Reflex.Dom.Core
1216
1317import Common.Api
1418import Common.Route
15−import Obelisk.Generated.Static
19+
1620
1721frontend :: Frontend (R FrontendRoute)
1822frontend = Frontend
19− { _frontend_head = el "title" $ text "Obelisk Minimal Example"
23+ { _frontend_head = do
24+ el "title" $ text "Obelisk Minimal Example"
25+ elAttr "link" ("href" =: static @"main.css" <> "type" =: "text/css" <> "rel" =: "stylesheet") blank
2026 , _frontend_body = do
21− text "Welcome to Obelisk!"
27+ el "h1" $ text "Welcome to Obelisk!"
2228 el "p" $ text $ T.pack commonStuff
2329 elAttr "img" ("src" =: static @"obelisk.jpg") blank
2430 el "div" $ do
skeleton/static/main.cssnew file+3
@@ -0,0 +1,3 @@
1+p {
2+ color: red;
3+}