elm-mdl/examples/Demo/Grid.elm

39 lines
909 B
Elm
Raw Normal View History

2016-03-14 10:00:58 +00:00
module Demo.Grid where
import Material.Grid exposing (..)
import Html exposing (..)
view : List Html
view =
[ [1..12]
|> List.map (\i -> cell [size All 1] [text "1"])
2016-03-19 22:47:21 +00:00
|> grid []
2016-03-14 10:00:58 +00:00
, [1 .. 3]
|> List.map (\i -> cell [size All 4] [text <| "4"])
2016-03-19 22:47:21 +00:00
|> grid []
2016-03-14 10:00:58 +00:00
, [ cell [size All 6] [text "6"]
, cell [size All 4] [text "4"]
, cell [size All 2] [text "2"]
2016-03-19 22:47:21 +00:00
] |> grid []
2016-03-14 10:00:58 +00:00
, [ cell [size All 6, size Tablet 8] [text "6 (8 tablet)"]
, cell [size All 4, size Tablet 6] [text "4 (6 tablet)"]
, cell [size All 2, size Phone 4] [text "2 (4 phone)"]
2016-03-19 22:47:21 +00:00
] |> grid []
2016-03-14 10:00:58 +00:00
, Html.node "style" [] [text """
.mdl-cell {
text-sizing: border-box;
background-color: #BDBDBD;
height: 200px;
padding-left: 8px;
padding-top: 4px;
color: white;
}
.mdl-grid:first-of-type .mdl-cell {
height: 50px;
}
"""]
]
2016-03-19 22:47:21 +00:00