diff --git a/assets/css/style.css b/assets/css/style.css index 2e7e9e3..184c146 100644 --- a/assets/css/style.css +++ b/assets/css/style.css @@ -575,7 +575,80 @@ nav[aria-label="breadcrumb"] li:last-child a{ /*================================================================= Shortcodes =================================================================*/ + +details { + margin: 1rem auto; + padding: 0 1rem; + /* width: 35em; */ + max-width: calc(100% - 2rem); + position: relative; + border: 1px solid #78909C; + border-radius: 6px; + background-color: #040b1e; + color: #c9a5e7; + transition: background-color 0.15s; +} +details > :last-child { + margin-bottom: 1rem; +} + +details::before { + width: 100%; + height: 100%; + content: ""; + position: absolute; + top: 0; + left: 0; + border-radius: inherit; + opacity: 0.15; + box-shadow: 0 0.25em 0.5em #263238; + pointer-events: none; + transition: opacity 0.2s; + z-index: -1; +} + +details[open] { + background-color: #040b1e; +} + +details[open]::before { + opacity: 0.6; +} + +summary { + padding: 1rem 2em 1rem 0; + display: block; + position: relative; + font-size: 1.33em; + font-weight: bold; + cursor: pointer; +} + +summary::before, summary::after { + width: 0.75em; + height: 2px; + position: absolute; + top: 50%; + right: 0; + content: ""; + background-color: currentColor; + text-align: right; + transform: translateY(-50%); + transition: transform 0.2s ease-in-out; +} + +summary::after { + transform: translateY(-50%) rotate(90deg); +} + +[open] summary::after { + transform: translateY(-50%) rotate(180deg); +} + +summary::-webkit-details-marker { + display: none; +} /*================================================================= Code Blocks diff --git a/layouts/shortcodes/details.html b/layouts/shortcodes/details.html new file mode 100644 index 0000000..04e4bfd --- /dev/null +++ b/layouts/shortcodes/details.html @@ -0,0 +1,4 @@ +
+ {{ (.Get 0) | markdownify }} + {{ .Inner | $.Page.RenderString (dict "display" "block") }} +
\ No newline at end of file