This commit is contained in:
Matthew Griffith 2019-06-12 19:53:32 -04:00
commit 0b5ee21646
3 changed files with 20 additions and 10 deletions

View File

@ -105,9 +105,11 @@ If alignment is set on elements in a layout such as `row`, then the element will
will result in a layout like
|-|-| |-| |-|
|-|-| |-| |-|
Where there are two elements on the left, one in the center, and one on the right.
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.
**Note** For text alignment, check out `Element.Font`!
@docs centerX, centerY, alignLeft, alignRight, alignTop, alignBottom
@ -1532,13 +1534,21 @@ type Orientation
classifyDevice : { window | height : Int, width : Int } -> Device
classifyDevice window =
{ class =
if window.width <= 600 then
let
shortSide =
if window.width < window.height then
window.width
else
window.height
in
if shortSide <= 600 then
Phone
else if window.width > 600 && window.width <= 1200 then
else if shortSide > 600 && shortSide <= 1200 then
Tablet
else if window.width > 1200 && window.width <= 1800 then
else if shortSide > 1200 && shortSide <= 1800 then
Desktop
else
@ -1555,7 +1565,7 @@ classifyDevice window =
{-| When designing it's nice to use a modular scale to set spacial rythms.
scaled =
Scale.modular 16 1.25
Element.modular 16 1.25
A modular scale starts with a number, and multiplies it by a ratio a number of times.
Then, when setting font sizes you can use:

View File

@ -35,7 +35,7 @@ image src =
Internal.Attr (VirtualDom.style "background" ("url(\"" ++ src ++ "\") center / cover no-repeat"))
{-| A centered background image that keeps its natural propostions, but scales to fit the space.
{-| A centered background image that keeps its natural proportions, but scales to fit the space.
-}
uncropped : String -> Attribute msg
uncropped src =

View File

@ -741,8 +741,8 @@ textHelper textInput attrs textOptions =
case textInput.type_ of
TextInputNode inputType ->
( "input"
, [ value textOptions.text
, Internal.Attr (Html.Attributes.type_ inputType)
, [ Internal.Attr (Html.Attributes.type_ inputType)
, value textOptions.text
, spellcheck textInput.spellchecked
, Internal.htmlClass classes.inputText
, case textInput.autofill of
@ -759,7 +759,7 @@ textHelper textInput attrs textOptions =
TextArea ->
let
{ maybePadding, heightContent, maybeSpacing, adjustedAttributes, maybeBorder } =
attributes
(value textOptions.text :: attributes)
|> List.foldr
(\attr found ->
case attr of