mirror of
https://github.com/NoRedInk/noredink-ui.git
synced 2024-11-28 01:45:20 +03:00
Adds fullheight to controls
since the container doesn't have a min height, the Container doesn't stretch in the example
This commit is contained in:
parent
6dec2ee268
commit
d096fa6b3a
@ -11,8 +11,18 @@ module Nri.Ui.Container.V2 exposing
|
||||
- adds optional default spacing?
|
||||
- document changes from V1 (e.g., how to upgrade from V1)
|
||||
|
||||
Common NoRedInk Containers
|
||||
|
||||
# Common NoRedInk Containers
|
||||
|
||||
# Changelog
|
||||
|
||||
|
||||
## Changes from V1
|
||||
|
||||
- fullHeight accepts a bool value
|
||||
|
||||
|
||||
# Documentation
|
||||
|
||||
|
||||
## View
|
||||
@ -70,9 +80,9 @@ paddingPx padding =
|
||||
|
||||
{-| Makes the container occupy the full height of the parent.
|
||||
-}
|
||||
fullHeight : Attribute msg
|
||||
fullHeight =
|
||||
Attribute <| \config -> { config | fullHeight = True }
|
||||
fullHeight : Bool -> Attribute msg
|
||||
fullHeight fullHeight_ =
|
||||
Attribute <| \config -> { config | fullHeight = fullHeight_ }
|
||||
|
||||
|
||||
{-| Use this helper to add custom attributes.
|
||||
|
@ -82,6 +82,7 @@ init =
|
||||
{ control =
|
||||
ControlExtra.list
|
||||
|> ControlExtra.optionalListItem "paddingPx" controlMaybePaddingPx
|
||||
|> ControlExtra.optionalListItem "fullHeight" controlMaybeFullHeight
|
||||
|> ControlExtra.listItem "content" controlContent
|
||||
}
|
||||
|
||||
@ -92,6 +93,12 @@ controlMaybePaddingPx =
|
||||
Control.map Container.paddingPx (ControlExtra.float 20)
|
||||
|
||||
|
||||
controlMaybeFullHeight : Control (Maybe (Container.Attribute msg))
|
||||
controlMaybeFullHeight =
|
||||
Control.maybe False <|
|
||||
Control.map Container.fullHeight (Control.bool False)
|
||||
|
||||
|
||||
controlContent : Control (Container.Attribute msg)
|
||||
controlContent =
|
||||
Control.choice
|
||||
|
Loading…
Reference in New Issue
Block a user