add exception for exact height in columns

This commit is contained in:
Matthew Griffith 2019-07-06 10:29:13 -04:00
parent 563e86266a
commit 3b1f4b6a6b
3 changed files with 25 additions and 14 deletions

View File

@ -1055,7 +1055,7 @@ gatherAttrRecursive classes node has transform styles attrs children elementAttr
name =
"height-px-" ++ val
in
gatherAttrRecursive (name ++ " " ++ classes)
gatherAttrRecursive (Internal.Style.classes.heightExact ++ " " ++ name ++ " " ++ classes)
node
(Flag.add Flag.height has)
transform
@ -1443,7 +1443,7 @@ renderHeight h =
"height-px-" ++ val
in
( Flag.none
, name
, Internal.Style.classes.heightExact ++ " " ++ name
, [ Single name "height" (val ++ "px") ]
)

View File

@ -148,6 +148,7 @@ classes =
, widthFillPortion = "wfp"
, heightFill = "hf"
, heightContent = "hc"
, heightExact = "he"
, heightFillPortion = "hfp"
, seButton = "sbt"
@ -1344,9 +1345,14 @@ baseSheet =
, Descriptor (dot classes.column)
[ Prop "display" "flex"
, Prop "flex-direction" "column"
-- This should resolve this
-- https://github.com/mdgriffith/elm-ui/pull/43
-- But things break
-- TODO: why do they break??
, Child (dot classes.any)
[ Prop "flex-basis" "0%"
, Descriptor (dot classes.widthExact)
, Descriptor (dot classes.heightExact)
[ Prop "flex-basis" "auto"
]
]
@ -1364,7 +1370,7 @@ baseSheet =
Prop "width" "100%"
]
-- TODO:: THIs might be necessary, maybe it should move to widthFill?
-- TODO:: This might be necessary, maybe it should move to widthFill?
-- , Child (dot classes.widthFill)
-- [ Prop "align-self" "stretch"
-- , Descriptor (dot classes.alignedHorizontally)

View File

@ -16,7 +16,6 @@ module Testable.Element exposing
, fill
, fillPortion
, height
, heightHelper
, inFront
, isVisible
, label
@ -36,7 +35,6 @@ module Testable.Element exposing
, textColumn
, transparent
, width
, widthHelper
)
{-| This module should mirror the top level `Element` api, with one important distinction.
@ -300,10 +298,12 @@ widthHelper maybeMin maybeMax len =
)
, test =
\found _ ->
Expect.true "exact width is exact"
((floor found.self.bbox.width == val)
&& minMaxTest (floor found.self.bbox.width)
)
Expect.all
[ \_ ->
Expect.true "exact width is exact" (floor found.self.bbox.width == val)
, \_ -> Expect.true "min/max is upheld" (minMaxTest (floor found.self.bbox.width))
]
()
}
Fill portion ->
@ -459,10 +459,15 @@ heightHelper maybeMin maybeMax len =
)
, test =
\found _ ->
Expect.true "exact height is exact"
((floor found.self.bbox.height == val)
&& minMaxTest (floor found.self.bbox.height)
)
Expect.all
[ \_ ->
Expect.true ("exact height is exact: " ++ String.fromInt (floor found.self.bbox.height) ++ "," ++ String.fromInt val)
(floor found.self.bbox.height == val)
, \_ ->
Expect.true "min/max holds true"
(minMaxTest (floor found.self.bbox.height))
]
()
}
Fill portion ->