gdotdesign / elm-ui

UI library for making web applications with Elm
https://elm-ui.netlify.com
BSD 2-Clause "Simplified" License
923 stars 39 forks source link

Allow multiple modal widths #58

Open mrozbarry opened 7 years ago

mrozbarry commented 7 years ago

It would be nice to be able to set a small/medium/large width on modals, or allow some style overrides for the width.

gdotdesign commented 7 years ago

Modals fit their contents, they have only max-width: 80vw and max-height: 80vh set as constraints which can be removed.

We can add optional width and height in it's ViewModel like so:

type alias ViewModel msg =
  { contents : List (Html.Html msg)
  , footer : List (Html.Html msg)
  , address : (Msg -> msg)
  , title : String

  , width : Maybe Float
  , height : Maybe Float
  }

But I don't know if it's justified enough to do so, because the width and height of ui-modal-wrapper can be set easily with CSS.