Skip to content

Commit

Permalink
mobile fixes css
Browse files Browse the repository at this point in the history
  • Loading branch information
maddalax committed Nov 25, 2024
1 parent baf1041 commit ab50eae
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion htmgo-site/pages/examples/code.go
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,6 @@ func renderCodeToString(snippet *Snippet) *h.Element {
Code: source,
Lang: "go",
CustomStyles: []string{"border-radius: 0.5rem;"},
WrapLines: true,
WrapLines: false,
})
}
10 changes: 5 additions & 5 deletions htmgo-site/pages/examples/index.go
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand All @@ -99,19 +99,19 @@ 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 != "",
h.Div(
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,
),
Expand Down
2 changes: 1 addition & 1 deletion htmgo-site/ui/snippet.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"),
Expand Down

0 comments on commit ab50eae

Please sign in to comment.