mirror of
https://github.com/NoRedInk/noredink-ui.git
synced 2024-11-24 08:53:33 +03:00
💀 remove fullheight. it's not working, it requires changes to the container of Container, and it's only used one place in the monolith
This commit is contained in:
parent
91feb06746
commit
3dc8e3ebf2
@ -1,6 +1,6 @@
|
||||
module Nri.Ui.Container.V2 exposing
|
||||
( view, Attribute
|
||||
, paddingPx, fullHeight, custom, css, testId, id
|
||||
, paddingPx, custom, css, testId, id
|
||||
, plaintext, markdown, html
|
||||
, gray, default, disabled, invalid, pillow, buttony
|
||||
)
|
||||
@ -19,7 +19,7 @@ Common NoRedInk Containers
|
||||
|
||||
## Changes from V1
|
||||
|
||||
- fullHeight accepts a bool value
|
||||
- remove fullHeight
|
||||
|
||||
|
||||
# Documentation
|
||||
@ -28,7 +28,7 @@ Common NoRedInk Containers
|
||||
## View
|
||||
|
||||
@docs view, Attribute
|
||||
@docs paddingPx, fullHeight, custom, css, testId, id
|
||||
@docs paddingPx, custom, css, testId, id
|
||||
|
||||
|
||||
## Content
|
||||
@ -64,7 +64,6 @@ type Attribute msg
|
||||
type alias Settings msg =
|
||||
{ containerType : String
|
||||
, padding : Float
|
||||
, fullHeight : Bool
|
||||
, css : List Css.Style
|
||||
, content : List (Html msg)
|
||||
, attributes : List (Html.Attribute msg)
|
||||
@ -78,13 +77,6 @@ paddingPx padding =
|
||||
Attribute <| \config -> { config | padding = padding }
|
||||
|
||||
|
||||
{-| Makes the container occupy the full height of the parent.
|
||||
-}
|
||||
fullHeight : Bool -> Attribute msg
|
||||
fullHeight fullHeight_ =
|
||||
Attribute <| \config -> { config | fullHeight = fullHeight_ }
|
||||
|
||||
|
||||
{-| Use this helper to add custom attributes.
|
||||
|
||||
Do NOT use this helper to add css styles, as they may not be applied the way
|
||||
@ -132,15 +124,7 @@ view attributes =
|
||||
in
|
||||
Nri.Ui.styled div
|
||||
settings.containerType
|
||||
([ padding (px settings.padding)
|
||||
, if settings.fullHeight then
|
||||
height (pct 100)
|
||||
|
||||
else
|
||||
batch []
|
||||
]
|
||||
++ settings.css
|
||||
)
|
||||
(padding (px settings.padding) :: settings.css)
|
||||
settings.attributes
|
||||
settings.content
|
||||
|
||||
@ -156,7 +140,6 @@ defaultSettings : Settings msg
|
||||
defaultSettings =
|
||||
{ containerType = "default-container"
|
||||
, padding = 20
|
||||
, fullHeight = False
|
||||
, css = defaultStyles
|
||||
, content = []
|
||||
, attributes = []
|
||||
|
@ -80,8 +80,7 @@ viewExample : { name : String, description : String } -> List (Container.Attribu
|
||||
viewExample { name, description } attributes =
|
||||
Html.section
|
||||
[ css
|
||||
[ Css.marginTop (Css.px 8)
|
||||
, Css.minHeight (Css.px 150)
|
||||
[ Css.marginTop (Css.px 20)
|
||||
]
|
||||
]
|
||||
[ Heading.h3 [] [ Html.text name ]
|
||||
@ -102,7 +101,6 @@ init =
|
||||
{ control =
|
||||
ControlExtra.list
|
||||
|> ControlExtra.optionalListItem "paddingPx" controlPaddingPx
|
||||
|> ControlExtra.optionalListItem "fullHeight" controlFullHeight
|
||||
|> ControlExtra.optionalListItem "css" controlCss
|
||||
|> ControlExtra.listItem "content" controlContent
|
||||
}
|
||||
@ -113,16 +111,12 @@ controlPaddingPx =
|
||||
Control.map Container.paddingPx (ControlExtra.float 20)
|
||||
|
||||
|
||||
controlFullHeight : Control (Container.Attribute msg)
|
||||
controlFullHeight =
|
||||
Control.map Container.fullHeight (Control.bool False)
|
||||
|
||||
|
||||
controlCss : Control (Container.Attribute msg)
|
||||
controlCss =
|
||||
Control.map Container.css
|
||||
(Control.value
|
||||
[ Css.hover [ Css.backgroundColor Colors.glacier ]
|
||||
[ Css.minHeight (Css.px 100)
|
||||
, Css.hover [ Css.backgroundColor Colors.glacier ]
|
||||
]
|
||||
)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user