git.iko.soy/typeable/elm-ui
on master help sign in
Merge branch 'master' of https://github.com/mdgriffith/elm-ui
0b5ee21Matthew Griffith
src/Element.elm+16−6
@@ -105,9 +105,11 @@ If alignment is set on elements in a layout such as `row`, then the element will
105
105
106will result in a layout like
106will result in a layout like
107
107
108− |-|-| |-| |-|
108+ |-|-| |-| |-|
109
109
110−Where there are two elements on the left, one in the center, and one on the right.
110+Where there are two elements on the left, one on the right, and one in the center of the space between the elements on the left and right.
111+
112+**Note** For text alignment, check out `Element.Font`!
111
113
112@docs centerX, centerY, alignLeft, alignRight, alignTop, alignBottom
114@docs centerX, centerY, alignLeft, alignRight, alignTop, alignBottom
113
115
@@ -1532,13 +1534,21 @@ type Orientation
1532classifyDevice : { window | height : Int, width : Int } -> Device
1534classifyDevice : { window | height : Int, width : Int } -> Device
1533classifyDevice window =
1535classifyDevice window =
1534 { class =
1536 { class =
1537+ let
1538+ shortSide =
1535− if window.width <= 600 then
1539+ if window.width < window.height then
1540+ window.width
1541+
1542+ else
1543+ window.height
1544+ in
1545+ if shortSide <= 600 then
1536 Phone
1546 Phone
1537
1547
1538− else if window.width > 600 && window.width <= 1200 then
1548+ else if shortSide > 600 && shortSide <= 1200 then
1539 Tablet
1549 Tablet
1540
1550
1541− else if window.width > 1200 && window.width <= 1800 then
1551+ else if shortSide > 1200 && shortSide <= 1800 then
1542 Desktop
1552 Desktop
1543
1553
1544 else
1554 else
@@ -1555,7 +1565,7 @@ classifyDevice window =
1555{-| When designing it's nice to use a modular scale to set spacial rythms.
1565{-| When designing it's nice to use a modular scale to set spacial rythms.
1556
1566
1557 scaled =
1567 scaled =
1558− Scale.modular 16 1.25
1568+ Element.modular 16 1.25
1559
1569
1560A modular scale starts with a number, and multiplies it by a ratio a number of times.
1570A modular scale starts with a number, and multiplies it by a ratio a number of times.
1561Then, when setting font sizes you can use:
1571Then, when setting font sizes you can use:
src/Element/Background.elm+1−1
@@ -35,7 +35,7 @@ image src =
35 Internal.Attr (VirtualDom.style "background" ("url(\"" ++ src ++ "\") center / cover no-repeat"))
35 Internal.Attr (VirtualDom.style "background" ("url(\"" ++ src ++ "\") center / cover no-repeat"))
36
36
37
37
38−{-| A centered background image that keeps its natural propostions, but scales to fit the space.
38+{-| A centered background image that keeps its natural proportions, but scales to fit the space.
39-}
39-}
40uncropped : String -> Attribute msg
40uncropped : String -> Attribute msg
41uncropped src =
41uncropped src =
src/Element/Input.elm+3−3
@@ -741,8 +741,8 @@ textHelper textInput attrs textOptions =
741 case textInput.type_ of
741 case textInput.type_ of
742 TextInputNode inputType ->
742 TextInputNode inputType ->
743 ( "input"
743 ( "input"
744− , [ value textOptions.text
745− , Internal.Attr (Html.Attributes.type_ inputType)
744+ , [ Internal.Attr (Html.Attributes.type_ inputType)
745+ , value textOptions.text
746 , spellcheck textInput.spellchecked
746 , spellcheck textInput.spellchecked
747 , Internal.htmlClass classes.inputText
747 , Internal.htmlClass classes.inputText
748 , case textInput.autofill of
748 , case textInput.autofill of
@@ -759,7 +759,7 @@ textHelper textInput attrs textOptions =
759 TextArea ->
759 TextArea ->
760 let
760 let
761 { maybePadding, heightContent, maybeSpacing, adjustedAttributes, maybeBorder } =
761 { maybePadding, heightContent, maybeSpacing, adjustedAttributes, maybeBorder } =
762− attributes
762+ (value textOptions.text :: attributes)
763 |> List.foldr
763 |> List.foldr
764 (\attr found ->
764 (\attr found ->
765 case attr of
765 case attr of