Skip to content

Commit

Permalink
fix: only display button in single pages
Browse files Browse the repository at this point in the history
  • Loading branch information
HEIGE-PCloud committed Dec 24, 2024
1 parent 24b19a0 commit a71e9c7
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 130 deletions.
150 changes: 20 additions & 130 deletions assets/css/main.css
Original file line number Diff line number Diff line change
Expand Up @@ -781,60 +781,38 @@ html.dark {
position: fixed;
}

.tw-bottom-20 {
bottom: 5rem;
}

.tw-bottom-10 {
bottom: 2.5rem;
}

.tw-bottom-12 {
bottom: 3rem;
}

.tw-bottom-8 {
bottom: 2rem;
}

.tw-right-6 {
right: 1.5rem;
}

.tw-right-8 {
right: 2rem;
.tw-bottom-4 {
bottom: 1rem;
}

.tw-right-4 {
right: 1rem;
}

.tw-bottom-4 {
bottom: 1rem;
}

.tw-m-0 {
margin: 0px;
}

.tw-m-4 {
margin: 1rem;
}

.tw-m-2 {
margin: 0.5rem;
}

.\!tw-my-1 {
margin-top: 0.25rem !important;
margin-bottom: 0.25rem !important;
}

.tw-mx-0 {
margin-left: 0px;
margin-right: 0px;
}

.tw-mx-2 {
margin-left: 0.5rem;
margin-right: 0.5rem;
}

.tw-mx-4 {
margin-left: 1rem;
margin-right: 1rem;
}

.tw-my-2 {
margin-top: 0.5rem;
margin-bottom: 0.5rem;
Expand All @@ -845,36 +823,15 @@ html.dark {
margin-bottom: 1rem;
}

.tw-my-0 {
margin-top: 0px;
margin-bottom: 0px;
}

.tw-mx-4 {
margin-left: 1rem;
margin-right: 1rem;
}

.tw-mx-auto {
margin-left: auto;
margin-right: auto;
}

.tw-mx-0 {
margin-left: 0px;
margin-right: 0px;
}

.tw-my-8 {
margin-top: 2rem;
margin-bottom: 2rem;
}

.tw-my-6 {
margin-top: 1.5rem;
margin-bottom: 1.5rem;
}

.tw-ml-16 {
margin-left: 4rem;
}

.tw-ml-4 {
margin-left: 1rem;
}
Expand All @@ -883,42 +840,6 @@ html.dark {
margin-right: 0.25rem;
}

.tw-mr-0 {
margin-right: 0px;
}

.tw-ml-10 {
margin-left: 2.5rem;
}

.tw-ml-\[20\] {
margin-left: 20;
}

.tw-ml-\[20px\] {
margin-left: 20px;
}

.tw-ml-\[200px\] {
margin-left: 200px;
}

.tw-ml-8 {
margin-left: 2rem;
}

.tw-ml-1 {
margin-left: 0.25rem;
}

.tw-ml-16 {
margin-left: 4rem;
}

.tw-ml-2 {
margin-left: 0.5rem;
}

.\!tw-block {
display: block !important;
}
Expand Down Expand Up @@ -976,10 +897,6 @@ html.dark {
width: 100%;
}

.tw-w-11\/12 {
width: 91.666667%;
}

.tw-max-w-full {
max-width: 100%;
}
Expand Down Expand Up @@ -1017,10 +934,6 @@ html.dark {
justify-content: space-between;
}

.tw-gap-2 {
gap: 0.5rem;
}

.tw-gap-1 {
gap: 0.25rem;
}
Expand All @@ -1041,10 +954,6 @@ html.dark {
border-radius: 9999px;
}

.tw-rounded {
border-radius: 0.25rem;
}

.tw-border-t-2 {
border-top-width: 2px;
}
Expand All @@ -1062,27 +971,18 @@ html.dark {
background-color: transparent;
}

.tw-bg-white {
--tw-bg-opacity: 1;
background-color: rgb(255 255 255 / var(--tw-bg-opacity, 1));
}

.tw-p-0 {
padding: 0px;
}

.tw-p-4 {
padding: 1rem;
}

.tw-p-2 {
padding: 0.5rem;
}

.tw-p-1 {
padding: 0.25rem;
}

.tw-p-4 {
padding: 1rem;
}

.tw-px-4 {
padding-left: 1rem;
padding-right: 1rem;
Expand All @@ -1093,11 +993,6 @@ html.dark {
padding-bottom: 0.5rem;
}

.tw-py-0 {
padding-top: 0px;
padding-bottom: 0px;
}

.tw-pb-8 {
padding-bottom: 2rem;
}
Expand All @@ -1120,11 +1015,6 @@ html.dark {
line-height: 1.5rem;
}

.tw-text-xl {
font-size: 1.25rem;
line-height: 1.75rem;
}

.tw-uppercase {
text-transform: uppercase;
}
Expand Down
3 changes: 3 additions & 0 deletions layouts/_default/baseof.html
Original file line number Diff line number Diff line change
Expand Up @@ -88,9 +88,12 @@
{{ partial "plugin/fontawesome.html" (dict "Style" "solid" "Icon" "arrow-up") }}
</a>

{{/* toc dialog button */}}
{{- if .Page.Scratch.Get "enableTocDialog" -}}
<button id="toc-drawer-button" class="tw-block tw-bg-bgColor-secondary tw-rounded-full tw-text-base tw-p-1 md:tw-hidden">
{{ partial "plugin/fontawesome.html" (dict "Style" "solid" "Icon" "bars") }}
</button>
{{- end -}}

{{- /* comment button */ -}}
{{- if .Page.Scratch.Get "enableComment" -}}
Expand Down
1 change: 1 addition & 0 deletions layouts/posts/single.html
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ <h2 class="toc-title">{{ T "contents" }}</h2>
{{- end -}}

{{/* TOC Dialog */}}
{{- .Page.Scratch.Set "enableTocDialog" true -}}
<dialog id="toc-dialog" class="tw-max-w-full tw-w-full tw-max-h-full tw-h-full tw-ml-16">
<div class="toc tw-mx-4 tw-max-w-full">
<h2 class="tw-mx-0 tw-my-6 tw-uppercase tw-text-2xl">{{ T "contents" }}</h2>
Expand Down

0 comments on commit a71e9c7

Please sign in to comment.