aboutsummaryrefslogtreecommitdiff
path: root/src/View/ActivatedClasses.elm
blob: 85b0841d334f4476080d86e9030efea5b4424dcd (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
module View.ActivatedClasses
  ( activatedClasses
  ) where

import Html
import Html.Attributes exposing (..)
import List
import String

activatedClasses : List (Bool, String) -> Html.Attribute
activatedClasses =
  class
  << String.concat
  << List.intersperse " "
  << List.filterMap (\(activated, str) -> if activated then Just str else Nothing)