about summary refs log tree commit diff
path: root/users/wpcarro/assessments/tt/client/src/Tailwind.elm
diff options
context:
space:
mode:
Diffstat (limited to 'users/wpcarro/assessments/tt/client/src/Tailwind.elm')
-rw-r--r--users/wpcarro/assessments/tt/client/src/Tailwind.elm29
1 files changed, 29 insertions, 0 deletions
diff --git a/users/wpcarro/assessments/tt/client/src/Tailwind.elm b/users/wpcarro/assessments/tt/client/src/Tailwind.elm
new file mode 100644
index 0000000000..57d419db5a
--- /dev/null
+++ b/users/wpcarro/assessments/tt/client/src/Tailwind.elm
@@ -0,0 +1,29 @@
+module Tailwind exposing (..)
+
+{-| Functions to make Tailwind development in Elm even more pleasant.
+-}
+
+
+{-| Conditionally use `class` selection when `condition` is true.
+-}
+when : Bool -> String -> String
+when condition class =
+    if condition then
+        class
+
+    else
+        ""
+
+
+if_ : Bool -> String -> String -> String
+if_ condition whenTrue whenFalse =
+    if condition then
+        whenTrue
+
+    else
+        whenFalse
+
+
+use : List String -> String
+use styles =
+    String.join " " styles