Skip to content

Instantly share code, notes, and snippets.

@Chadtech
Created July 20, 2018 17:09
Show Gist options
  • Save Chadtech/095c5b831d0143cdf54da4d488e24a31 to your computer and use it in GitHub Desktop.
Save Chadtech/095c5b831d0143cdf54da4d488e24a31 to your computer and use it in GitHub Desktop.
module Html.Custom
exposing
( container
, row
, column
)
import Html.Grid as Grid
import Html exposing (Html)
container : List (Attributes msg) -> List (Html msg) -> Html msg
container =
grid.container
row : Grid.Position -> List (Attributes msg) -> List (Html msg) -> Html msg
row =
grid.row
column : Grid.Position -> List (Attributes msg) -> List (Html msg) -> Html msg
column =
grid.column
grid : Grid.System
grid =
{ columns =
[ (Grid.px 40)
, (Grid.auto)
, (Grid.px 120)
]
, rows =
[ Grid.px 100 ]
}
|> Grid.init
-- In Html.Grid.elm --
type alias System =
{ row : Position -> List (Attributes msg) -> List (Html msg) -> Html msg
, column : Position -> List (Attributes msg) -> List (Html msg) -> Html msg
, contianer : List (Attributes msg) -> List (Html msg) -> Html msg
}
init : { columns : List Spacing , rows : List Spacing } -> System
type Spacing
= Auto
| Px Float
| Label String --???
type Position
= Index Int
| Label
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment