Skip to content

Commit

Permalink
feat(tailwind): Add tailwind module
Browse files Browse the repository at this point in the history
  • Loading branch information
Kevin COMBRIAT committed Sep 7, 2020
1 parent 1e97b71 commit b89914a
Show file tree
Hide file tree
Showing 3 changed files with 92,261 additions and 1 deletion.
5 changes: 5 additions & 0 deletions src/Component/HTML/Utils.purs
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,13 @@ module Component.HTML.Utils where

import Prelude
import Data.Route (Route, routeCodec)
import Halogen as H
import Halogen.HTML.Properties as HP
import Routing.Duplex (print)
import Tailwind as TW

href :: forall r i. Route -> HP.IProp ( href String | r ) i
href = HP.href <<< append "#" <<< print routeCodec

tw :: forall r i. Array TW.Tailwind -> HP.IProp ( class String | r ) i
tw = HP.class_ <<< H.ClassName <<< TW.make
3 changes: 2 additions & 1 deletion src/Page/Home.purs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import Data.Maybe (Maybe(..))
import Data.Route (Route(..))
import Halogen as H
import Halogen.HTML as HH
import Tailwind as TW

data Action
= Initialize
Expand All @@ -32,7 +33,7 @@ component =
initialState = const { message: "", number: 0 }

render { message, number } =
HH.div_
HH.div [ HPU.tw [ TW.m1 ] ]
[ HH.div_ [ HH.text "Hello" ]
, HH.div_ [ HH.text message ]
, HH.div_ [ HH.text $ "Random number: " <> show number ]
Expand Down
Loading

0 comments on commit b89914a

Please sign in to comment.