@@ -27,41 +27,43 @@ module Element exposing
30−## Basic Elements
30+# Basic Elements
32@docs Element, none, text, el
32@docs Element, none, text, el
35−## Rows and Columns
35+# Rows and Columns
37−Rows and columns are the most common layouts.
37+When we want more than one child on an element, we want to be _specific_ about how they will be layed out.
39+So, the common ways to do that would be `row` and `column`.
39@docs row, wrappedRow, column
41@docs row, wrappedRow, column
42−## Text Layout
44+# Text Layout
44−Text needs it's own layout primitives.
46+Text layout needs some specific considerations.
46@docs paragraph, textColumn
48@docs paragraph, textColumn
49−## Data Table
51+# Data Table
51@docs Column, table, IndexedColumn, indexedTable
53@docs Column, table, IndexedColumn, indexedTable
56@docs Attribute, width, height, Length, px, shrink, fill, fillPortion, maximum, minimum
58@docs Attribute, width, height, Length, px, shrink, fill, fillPortion, maximum, minimum
59−## Debugging
61+# Debugging
61@docs explain
63@docs explain
64−## Padding and Spacing
66+# Padding and Spacing
66There's no concept of margin in `style-elements`, instead we have padding and spacing.
68There's no concept of margin in `style-elements`, instead we have padding and spacing.
@@ -79,12 +81,15 @@ Here's what we can expect:
80
82
84+**Note** `spacing` set on a `paragraph`, will set the pixel spacing between lines.
82@docs padding, paddingXY, paddingEach
87@docs padding, paddingXY, paddingEach
84@docs spacing, spacingXY, spaceEvenly
89@docs spacing, spacingXY, spaceEvenly
87−## Alignment
92+# Alignment
89Alignment can be used to align an `Element` within another `Element`.
94Alignment can be used to align an `Element` within another `Element`.
@@ -313,19 +318,18 @@ toRgb (Internal.Rgba r g b a) =
316−{-| The basic building block of your layout. Here we create a
321+{-| The basic building block of your layout.
320− view =
323+ howdy : Element msg
321− Element.el [] (Element.text "Hello!")
325+ Element.el [] (Element.text "Howdy!")
324type alias Element msg =
328type alias Element msg =
325 Internal.Element msg
329 Internal.Element msg
328−{-| Standard attribute which cannot be a decoration.
332+{-| An attribute that can be attached to an `Element`
330type alias Attribute msg =
334type alias Attribute msg =
331 Internal.Attribute () msg
335 Internal.Attribute () msg
@@ -534,7 +538,7 @@ forceHover =
534 Internal.HoverOption Internal.ForceHover
538 Internal.HoverOption Internal.ForceHover
537−{-| Nothing to see here!
541+{-| When you want to render exactly nothing.
539none : Element msg
543none : Element msg
@@ -559,16 +563,15 @@ You can think of an `el` as a `div`, but it can only hae one child.
560If you want multiple children, you'll need to use something like `row` or `column`
564If you want multiple children, you'll need to use something like `row` or `column`
562− import Color exposing (blue, darkBlue)
566+ import Element exposing (Element, rgb)
563− import Element exposing (Element)
564 import Element.Background as Background
567 import Element.Background as Background
565 import Element.Border as Border
568 import Element.Border as Border
567 myElement : Element msg
570 myElement : Element msg
568 myElement =
571 myElement =
569 Element.el
572 Element.el
570− [ Background.color blue
573+ [ Background.color (rgb 0 0.5 0)
571− , Border.color darkBlue
574+ , Border.color (rgb 0 0.7 0)
573 (Element.text "You've made a stylish element!")
576 (Element.text "You've made a stylish element!")
@@ -585,8 +588,7 @@ el attrs child =
585 (Internal.Unkeyed [ child ])
588 (Internal.Unkeyed [ child ])
588−{-| If you want a row of elements, use `row`!
590row : List (Attribute msg) -> List (Element msg) -> Element msg
592row : List (Attribute msg) -> List (Element msg) -> Element msg
591row attrs children =
593row attrs children =
592 Internal.element
594 Internal.element
@@ -618,7 +620,8 @@ column attrs children =
618 (Internal.Unkeyed children)
620 (Internal.Unkeyed children)
623+{-| Same as `row`, but will wrap if it takes up too much horizontal space.
622wrappedRow : List (Attribute msg) -> List (Element msg) -> Element msg
625wrappedRow : List (Attribute msg) -> List (Element msg) -> Element msg
623wrappedRow attrs children =
626wrappedRow attrs children =
@@ -1004,6 +1007,8 @@ Which will look something like
1005
1008
1010+**Note** `spacing` on a paragraph will set the pixel spacing between lines.
1008paragraph : List (Attribute msg) -> List (Element msg) -> Element msg
1013paragraph : List (Attribute msg) -> List (Element msg) -> Element msg
1009paragraph attrs children =
1014paragraph attrs children =
@@ -1156,6 +1161,11 @@ newTabLink attrs { url, label } =
1158{-| A link to download a file.
1163{-| A link to download a file.
1165+**Note** If you're using `Browser.application`, then this won't be enough to actually trigger a file download due to how `Browser.Navigation` works.
1167+[Here's a description of what needs to happen](https://github.com/elm/html/issues/175).
1160download :
1170download :
1161 List (Attribute msg)
1171 List (Attribute msg)