aboutsummaryrefslogtreecommitdiff
path: root/src/View/ActivatedClasses.elm
diff options
context:
space:
mode:
Diffstat (limited to 'src/View/ActivatedClasses.elm')
-rw-r--r--src/View/ActivatedClasses.elm15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/View/ActivatedClasses.elm b/src/View/ActivatedClasses.elm
new file mode 100644
index 0000000..9594448
--- /dev/null
+++ b/src/View/ActivatedClasses.elm
@@ -0,0 +1,15 @@
+module View.ActivatedClasses
+ ( activatedClasses
+ ) where
+
+import Html
+import Html.Attributes (..)
+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)