Add summary animation
Signed-off-by: Nikolaos Karaolidis <nick@karaolidis.com>
This commit is contained in:
@@ -12,7 +12,7 @@ blockquote {
|
|||||||
}
|
}
|
||||||
|
|
||||||
p {
|
p {
|
||||||
margin: 0 0 0.5rem 0;
|
margin: 0.5rem 0 0.5rem 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
p:last-child {
|
p:last-child {
|
||||||
|
@@ -62,3 +62,35 @@ p {
|
|||||||
li {
|
li {
|
||||||
margin: 0.5rem 0 0.5rem 0;
|
margin: 0.5rem 0 0.5rem 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
details {
|
||||||
|
background-color: var(--background-50);
|
||||||
|
padding: 1rem 1.5rem 1rem 1.5rem;
|
||||||
|
border-radius: 0.5rem;
|
||||||
|
|
||||||
|
p {
|
||||||
|
margin: 0.5rem 0 0.5rem 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
summary {
|
||||||
|
margin: 0.5rem;
|
||||||
|
font-weight: bold;
|
||||||
|
display: inline-flex;
|
||||||
|
align-items: center;
|
||||||
|
gap: 0.5rem;
|
||||||
|
cursor: pointer;
|
||||||
|
}
|
||||||
|
|
||||||
|
summary::before {
|
||||||
|
content: '';
|
||||||
|
border-width: 0.4rem;
|
||||||
|
border-style: solid;
|
||||||
|
border-color: transparent transparent transparent var(--text);
|
||||||
|
transition: transform 0.3s ease;
|
||||||
|
transform-origin: 25% 50%;
|
||||||
|
}
|
||||||
|
|
||||||
|
&[open] summary::before {
|
||||||
|
transform: rotate(90deg);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
5
layouts/_shortcodes/contents.html
Normal file
5
layouts/_shortcodes/contents.html
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
<details class="toc">
|
||||||
|
<summary>Post Contents</summary>
|
||||||
|
{{ .Page.TableOfContents }}
|
||||||
|
</details>
|
||||||
|
{{- /* chomp trailing newline */ -}}
|
Reference in New Issue
Block a user