From e8a145ae88b33eb799ece722801a3356d96b6e1a Mon Sep 17 00:00:00 2001 From: Ben Sima Date: Mon, 14 May 2018 08:45:09 -0700 Subject: [PATCH] Add examples to addClass and removeClass --- yesod-form/Yesod/Form/Functions.hs | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/yesod-form/Yesod/Form/Functions.hs b/yesod-form/Yesod/Form/Functions.hs index 77f1f840..847609b0 100644 --- a/yesod-form/Yesod/Form/Functions.hs +++ b/yesod-form/Yesod/Form/Functions.hs @@ -621,6 +621,12 @@ convertField to from (Field fParse fView fEnctype) = let -- | Removes a CSS class from the 'fsAttrs' in a 'FieldSettings'. -- +-- ==== __Examples__ +-- +-- > removeFormControl :: FieldSettings site -> FieldSettings site +-- > removeFormControl fs = fs { fsAttrs = newAttrs } +-- > where newAttrs = removeClass "form-control" (fsAttrs fs) +-- -- @since 1.6.2 removeClass :: Text -- ^ The class to remove -> [(Text, Text)] -- ^ List of existing 'fsAttrs' @@ -631,6 +637,12 @@ removeClass klass (other :rest) = other : removeClass klass rest -- | Adds a CSS class to the 'fsAttrs' in a 'FieldSettings'. -- +-- ==== __Examples__ +-- +-- > withLargeInput :: FieldSettings site -> FieldSettings site +-- > withLargeInput fs = fs { fsAttrs = newAttrs } +-- > where newAttrs = addClass "input-lg" (fsAttrs fs) +-- -- @since 1.6.2 addClass :: Text -- ^ The class to add -> [(Text, Text)] -- ^ List of existing 'fsAttrs'