From ab50eaecf411f84088cc0613c41254da0b53dc94 Mon Sep 17 00:00:00 2001 From: maddalax Date: Mon, 25 Nov 2024 10:34:22 -0600 Subject: [PATCH] mobile fixes css --- htmgo-site/pages/examples/code.go | 2 +- htmgo-site/pages/examples/index.go | 10 +++++----- htmgo-site/ui/snippet.go | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/htmgo-site/pages/examples/code.go b/htmgo-site/pages/examples/code.go index b06f854..0688f6c 100644 --- a/htmgo-site/pages/examples/code.go +++ b/htmgo-site/pages/examples/code.go @@ -69,6 +69,6 @@ func renderCodeToString(snippet *Snippet) *h.Element { Code: source, Lang: "go", CustomStyles: []string{"border-radius: 0.5rem;"}, - WrapLines: true, + WrapLines: false, }) } diff --git a/htmgo-site/pages/examples/index.go b/htmgo-site/pages/examples/index.go index c826b16..b77786d 100644 --- a/htmgo-site/pages/examples/index.go +++ b/htmgo-site/pages/examples/index.go @@ -76,7 +76,7 @@ func viewSourceButton(snippet *Snippet) *h.Element { func snippetView(ctx *h.RequestContext, snippet *Snippet) *h.Element { return h.Div( - h.Class("flex flex-col mx-auto items-center gap-6 max-w-[90vw] md:max-w-[75vw] xl:max-w-4xl px-8"), + h.Class("flex flex-col mx-auto items-center gap-6 w-full max-w-[90vw] md:max-w-[75vw] xl:max-w-4xl px-8"), h.Div( h.Class("flex flex-col gap-1 w-full"), h.H2( @@ -99,8 +99,8 @@ func snippetView(ctx *h.RequestContext, snippet *Snippet) *h.Element { ), ), h.Div( - h.ClassX("", map[string]bool{ - "mb-6 border px-8 py-4 rounded-md shadow-sm border-slate-200 w-full": snippet.externalRoute == "", + h.ClassX("w-full", map[string]bool{ + "mb-6 border px-8 py-4 rounded-md shadow-sm border-slate-200": snippet.externalRoute == "", }), h.IfElse( snippet.externalRoute != "", @@ -108,10 +108,10 @@ func snippetView(ctx *h.RequestContext, snippet *Snippet) *h.Element { h.Class("relative"), h.IFrame( snippet.externalRoute, - h.Class("h-full min-h-[800px] w-[50vw] rounded"), + h.Class("h-full min-h-[800px] max-w-[90vw] w-full rounded"), ), h.A( - h.Class("w-[50vw] rounded absolute top-0 left-0 h-full bg-gray-800 bg-opacity-50 backdrop-blur-[2px] flex items-center justify-center cursor-pointer"), + h.Class("max-w-[90vw] w-full rounded absolute top-0 left-0 h-full bg-gray-800 bg-opacity-50 backdrop-blur-[2px] flex items-center justify-center cursor-pointer"), h.Href( snippet.externalRoute, ), diff --git a/htmgo-site/ui/snippet.go b/htmgo-site/ui/snippet.go index c5e07f2..54d155d 100644 --- a/htmgo-site/ui/snippet.go +++ b/htmgo-site/ui/snippet.go @@ -68,7 +68,7 @@ func CodeSnippet(props CodeSnippetProps) *h.Element { } return h.Div( - h.Class("relative"), + h.Class("relative max-w-[90vw]"), h.Div( h.UnsafeRaw(props.Code), h.Class("hidden"),