From 067e4f815591272f5d20be76c0c6d389e9ce47c6 Mon Sep 17 00:00:00 2001 From: Tessa Kelly Date: Wed, 23 Mar 2022 11:10:18 -0700 Subject: [PATCH] Adds Style control --- styleguide-app/Examples/Heading.elm | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/styleguide-app/Examples/Heading.elm b/styleguide-app/Examples/Heading.elm index 7071de30..cb0d94d2 100644 --- a/styleguide-app/Examples/Heading.elm +++ b/styleguide-app/Examples/Heading.elm @@ -88,9 +88,29 @@ init = ControlExtra.list |> CommonControls.css { moduleName = "Heading", use = Heading.css } |> ControlExtra.optionalBoolListItem "error" ( "Heading.error", Heading.error ) + |> ControlExtra.optionalListItem "style" controlStyle } +controlStyle : Control ( String, Heading.Attribute msg ) +controlStyle = + [ ( "Top", Heading.Top ) + , ( "Tagline", Heading.Tagline ) + , ( "Subhead", Heading.Subhead ) + , ( "Small", Heading.Small ) + ] + |> List.map + (\( name, val ) -> + ( name + , Control.value + ( "Heading.style Heading." ++ name + , Heading.style val + ) + ) + ) + |> Control.choice + + type alias Settings = List ( String, Heading.Attribute Msg )