about summary refs log tree commit diff
path: root/scratch/habit-screens/client/src/UI.elm
diff options
context:
space:
mode:
authorWilliam Carroll <wpcarro@gmail.com>2020-10-11T09·15+0100
committerWilliam Carroll <wpcarro@gmail.com>2020-10-11T09·15+0100
commit0a15ea736611b60a2e30001a03c85c9940584494 (patch)
tree6ee3b6b633115c6f844231b768fb56d13b905926 /scratch/habit-screens/client/src/UI.elm
parent106457de4b5fc8172ce302eaa61c7625150e67a1 (diff)
Create UI module for common components
Create UI.elm to house components like `button`, which is a simple HTML button
with `focus:outline-none` applied as a `class`, which is an accessibility
feature that I don't need for this touch-screen application.

I like this pattern more than my more opinionated patterns for UI modules in Elm
where I'd define all of the arguments as a record type (i.e. kwargs).
Diffstat (limited to 'scratch/habit-screens/client/src/UI.elm')
-rw-r--r--scratch/habit-screens/client/src/UI.elm9
1 files changed, 9 insertions, 0 deletions
diff --git a/scratch/habit-screens/client/src/UI.elm b/scratch/habit-screens/client/src/UI.elm
new file mode 100644
index 000000000000..5b5426913570
--- /dev/null
+++ b/scratch/habit-screens/client/src/UI.elm
@@ -0,0 +1,9 @@
+module UI exposing (..)
+
+import Html exposing (..)
+import Html.Attributes exposing (..)
+
+
+button : List (Attribute msg) -> List (Html msg) -> Html msg
+button attrs children =
+    Html.button ([ class "focus:outline-none" ] ++ attrs) children