arowM/elm-neat-layout/2.0.1

NOTE: the latest version is 4.0.5

Neat.Media

Helper module for responsive design. The Neat.Media provides helper functions to handle width of the target element dynamically.

Core

type Media

Core data type.

element : Media -> Maybe Element

Take Element of the target element form Media.

type alias Element =
{ scene :
{ width : Float
, height : Float
}
, viewport :
{ x : Float
, y : Float
, width : Float
, height : Float
}
, element :
{ x : Float
, y : Float
, width : Float
, height : Float
}
}

Reexport Browser.Dom.Element for convenience.

Functions for TEA

type Msg

Internal Msg

init : { root : RootElement } -> ( Media, Cmd Msg )

Initial state for TEA.

  • root: the target element you want to get its width
= Window
| RootWithId String

The target element you want to get its width.

  • Window: browser window
  • RootWithId: element specified by id attribute value
update : Msg -> Media -> ( Media, Cmd Msg )