Add examples to addClass and removeClass
This commit is contained in:
parent
c163a0841a
commit
e8a145ae88
@ -621,6 +621,12 @@ convertField to from (Field fParse fView fEnctype) = let
|
|||||||
|
|
||||||
-- | Removes a CSS class from the 'fsAttrs' in a 'FieldSettings'.
|
-- | 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
|
-- @since 1.6.2
|
||||||
removeClass :: Text -- ^ The class to remove
|
removeClass :: Text -- ^ The class to remove
|
||||||
-> [(Text, Text)] -- ^ List of existing 'fsAttrs'
|
-> [(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'.
|
-- | 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
|
-- @since 1.6.2
|
||||||
addClass :: Text -- ^ The class to add
|
addClass :: Text -- ^ The class to add
|
||||||
-> [(Text, Text)] -- ^ List of existing 'fsAttrs'
|
-> [(Text, Text)] -- ^ List of existing 'fsAttrs'
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user