mirror of
https://github.com/nunocoracao/blowfish.git
synced 2026-01-30 15:31:52 +00:00
fix(toc): too wide when no related contents
This commit is contained in:
@@ -245,6 +245,7 @@ body.zen-mode-enable {
|
|||||||
--font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono",
|
--font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono",
|
||||||
"Courier New", monospace;
|
"Courier New", monospace;
|
||||||
--spacing: 0.25rem;
|
--spacing: 0.25rem;
|
||||||
|
--container-2xs: 18rem;
|
||||||
--container-xs: 20rem;
|
--container-xs: 20rem;
|
||||||
--container-xl: 36rem;
|
--container-xl: 36rem;
|
||||||
--container-3xl: 48rem;
|
--container-3xl: 48rem;
|
||||||
@@ -3120,6 +3121,11 @@ body.zen-mode-enable {
|
|||||||
width: auto;
|
width: auto;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
.lg\:max-w-2xs {
|
||||||
|
@media (width >= 1024px) {
|
||||||
|
max-width: var(--container-2xs);
|
||||||
|
}
|
||||||
|
}
|
||||||
.lg\:max-w-7xl {
|
.lg\:max-w-7xl {
|
||||||
@media (width >= 1024px) {
|
@media (width >= 1024px) {
|
||||||
max-width: var(--container-7xl);
|
max-width: var(--container-7xl);
|
||||||
@@ -3638,11 +3644,6 @@ button, [role="button"] {
|
|||||||
.prose div.min-w-0.max-w-prose > *:first-child {
|
.prose div.min-w-0.max-w-prose > *:first-child {
|
||||||
margin-top: calc(var(--spacing) * 3);
|
margin-top: calc(var(--spacing) * 3);
|
||||||
}
|
}
|
||||||
#TableOfContents {
|
|
||||||
@media (width >= 1024px) {
|
|
||||||
max-width: 25vw;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
#TOCView {
|
#TOCView {
|
||||||
max-height: calc(100vh - 150px);
|
max-height: calc(100vh - 150px);
|
||||||
min-height: 0;
|
min-height: 0;
|
||||||
|
|||||||
@@ -66,10 +66,6 @@ button,
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Table of Contents */
|
/* Table of Contents */
|
||||||
#TableOfContents {
|
|
||||||
@apply lg:max-w-[25vw];
|
|
||||||
}
|
|
||||||
|
|
||||||
#TOCView {
|
#TOCView {
|
||||||
max-height: calc(100vh - 150px);
|
max-height: calc(100vh - 150px);
|
||||||
min-height: 0;
|
min-height: 0;
|
||||||
|
|||||||
@@ -33,17 +33,13 @@
|
|||||||
<section class="flex flex-col max-w-full mt-0 prose dark:prose-invert lg:flex-row">
|
<section class="flex flex-col max-w-full mt-0 prose dark:prose-invert lg:flex-row">
|
||||||
{{ $enableToc := .Params.showTableOfContents | default (site.Params.list.showTableOfContents | default false) }}
|
{{ $enableToc := .Params.showTableOfContents | default (site.Params.list.showTableOfContents | default false) }}
|
||||||
{{ $showToc := and $enableToc (in .TableOfContents "<ul") }}
|
{{ $showToc := and $enableToc (in .TableOfContents "<ul") }}
|
||||||
{{ $showRelated := site.Params.article.showRelatedPosts | default false }}
|
|
||||||
{{ $topClass := cond (hasPrefix site.Params.header.layout "fixed") "lg:top-[140px]" "lg:top-10" }}
|
{{ $topClass := cond (hasPrefix site.Params.header.layout "fixed") "lg:top-[140px]" "lg:top-10" }}
|
||||||
{{ if or $showToc $showRelated }}
|
{{ if $showToc }}
|
||||||
<div class="order-first lg:ml-auto px-0 lg:order-last lg:ps-8">
|
<div class="order-first lg:ml-auto px-0 lg:order-last lg:ps-8 lg:max-w-2xs">
|
||||||
<div class="toc ps-5 print:hidden lg:sticky {{ $topClass }}">
|
<div class="toc ps-5 print:hidden lg:sticky {{ $topClass }}">
|
||||||
{{ if $showToc }}
|
{{ if $showToc }}
|
||||||
{{ partial "toc.html" . }}
|
{{ partial "toc.html" . }}
|
||||||
{{ end }}
|
{{ end }}
|
||||||
{{ if $showRelated }}
|
|
||||||
sd
|
|
||||||
{{ end }}
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
{{ end }}
|
{{ end }}
|
||||||
|
|||||||
Reference in New Issue
Block a user