All Downloads are FREE. Search and download functionalities are using the official Maven repository.

zhttp.html.Template.scala Maven / Gradle / Ivy

There is a newer version: 2.0.0-RC11
Show newest version
package zhttp.html

/**
 * A ZIO Http styled general purpose templates
 */
object Template {

  def container(heading: CharSequence)(element: Html): Html = {
    html(
      head(
        title(s"ZIO Http - ${heading}"),
        style("""
                | body {
                |   font-family: monospace;
                |   font-size: 16px;
                |   background-color: #edede0;
                | }
                |""".stripMargin),
      ),
      body(
        div(
          styles := Seq("margin" -> "auto", "padding" -> "2em 4em", "max-width" -> "80%"),
          h1(heading),
          element,
        ),
      ),
    )
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy