Skip to content

Commit

Permalink
style: toc for dev-mode
Browse files Browse the repository at this point in the history
  • Loading branch information
alexiscolin committed Jan 21, 2025
1 parent 3141710 commit 719a733
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 2 deletions.
2 changes: 1 addition & 1 deletion gno.land/pkg/gnoweb/components/layouts/base.gohtml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<div class="sticky top-14 lg:pt-2 has-[ul:empty]:hidden">
<div id="sidebar-summary" class="max-h-screen overflow-scroll no-scrollbar bg-gray-50 lg:bg-transparent rounded-sm">
{{ template "ui/expend_label" "On this page"}}
<nav class="hidden lg:block text-100 mt-2 lg:mt-0 pb-6 lg:pb-28 px-4 py-2 lg:px-0 *:pl-0">
<nav class="toc-nav hidden lg:block text-100 mt-2 lg:mt-0 pb-6 lg:pb-28 px-4 py-2 lg:px-0 *:pl-0">
{{ . }}
</nav>
</div>
Expand Down
2 changes: 1 addition & 1 deletion gno.land/pkg/gnoweb/components/layouts/index.gohtml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
{{ template "layouts/header" .HeaderData }}

<!-- main -->
<main class="w-full grow-[2] {{ if .ContentData.IsDevmodView }}bg-gray-50{{ else }}bg-light{{end}}">
<main class="w-full grow-[2] {{ if .ContentData.IsDevmodView }}dev-mode bg-gray-50{{ else }}bg-light{{end}}">
<section class="max-w-screen-max mx-auto grid grid-flow-dense items-start min-h-full {{ if eq .ContentData.Layout "sidebar" }}px-4 md:px-10 grid-cols-1 lg:grid-cols-10 xl:grid-cols-10 gap-x-20 xxl:gap-x-32{{ else }} px-10 grid-cols-1 gap-8 xxl:gap-20{{ end }} {{ if .ContentData.View }}js-{{ .ContentData.View }}{{ end }}">
{{ .Body }}
</section>
Expand Down
10 changes: 10 additions & 0 deletions gno.land/pkg/gnoweb/frontend/css/input.css
Original file line number Diff line number Diff line change
Expand Up @@ -301,6 +301,16 @@
main :is(.realm-content, .source-code) > pre .chroma-ln {
@apply scroll-mt-24;
}

.dev-mode .toc-expend-btn {
@apply bg-gray-100 hover:bg-gray-50 cursor-pointer border lg:border-none lg:bg-transparent;
}
.dev-mode #sidebar-summary {
@apply bg-light lg:bg-transparent;
}
.dev-mode .toc-nav {
@apply font-mono;
}
}

@layer utilities {
Expand Down

0 comments on commit 719a733

Please sign in to comment.