Add title and topbar

This commit is contained in:
Paul-Henri Froidmont 2025-08-27 03:09:14 +02:00
parent 124239925d
commit fca87a4263
Signed by: phfroidmont
GPG key ID: BE948AFD7E7873BE
5 changed files with 14 additions and 10 deletions

View file

@ -1,3 +1,4 @@
import scalive.codecs.BooleanAsAttrPresenceCodec
import scalive.codecs.StringAsIsCodec
import scalive.defs.attrs.HtmlAttrs
import scalive.defs.complex.ComplexHtmlKeys
@ -5,7 +6,7 @@ import scalive.defs.tags.HtmlTags
package object scalive extends HtmlTags with HtmlAttrs with ComplexHtmlKeys:
lazy val defer = htmlAttr("defer", codecs.BooleanAsOnOffStringCodec)
lazy val defer = htmlAttr("defer", codecs.BooleanAsAttrPresenceCodec)
object phx:
private def phxAttr(suffix: String): HtmlAttr[String] =
@ -13,9 +14,10 @@ package object scalive extends HtmlTags with HtmlAttrs with ComplexHtmlKeys:
private def phxAttrJson(suffix: String): HtmlAttrJsonValue =
new HtmlAttrJsonValue(s"phx-$suffix")
private def dataPhxAttr(suffix: String): HtmlAttr[String] =
new HtmlAttr(s"data-phx-$suffix", StringAsIsCodec)
dataAttr(s"phx-$suffix")
private[scalive] lazy val session = dataPhxAttr("session")
private[scalive] lazy val main = htmlAttr("data-phx-main", BooleanAsAttrPresenceCodec)
lazy val click = phxAttrJson("click")
def value(key: String) = phxAttr(s"value-$key")