From 7388a81ebedb7ef8920bbb57d646b302b741fd09 Mon Sep 17 00:00:00 2001 From: Relintai Date: Sat, 6 Jan 2024 17:09:45 +0100 Subject: [PATCH] Better doc details styling from FWK. --- tools/doc/slate.css | 59 ++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 58 insertions(+), 1 deletion(-) diff --git a/tools/doc/slate.css b/tools/doc/slate.css index 213f943..9c769eb 100644 --- a/tools/doc/slate.css +++ b/tools/doc/slate.css @@ -90,9 +90,10 @@ body#md { font-weight: 300; } - .md pre.listing { font-size: 100%; + width: 97%; /*hack, i dont know how to align this width with every other element <@r-lyeh*/ + margin-left: 8px; } .md pre.listing code { @@ -247,3 +248,59 @@ body#md { } +/* Cool details theme from FWK */ +/* Stylize details/summary html tags */ +/* Credits: https://dev.to/vtrpldn/show-and-hide-content-easily-with-details-and-summary-html-tags-3eif */ + +/* The --padding variable help us control the
and spacing */ +:root { + --padding: 4px; /*16px;*/ /*<@r-lyeh*/ +} +details { + padding: 0 var(--padding); + box-shadow: inset 0 0 0 0px; /*4px;*/ /*<@r-lyeh*/ + border-radius: 1px; /*4px*/ /*<@r-lyeh*/ + + background-color:#333; /*<@r-lyeh*/ + margin: -15px 0 0 0; /*<@r-lyeh*/ /*fits all
together */ +} +summary { + padding-left: 16px; /*<@r-lyeh*/ + + + text-overflow: ellipsis; + /* Both of the following are required for text-overflow */ + white-space: nowrap; + overflow: hidden; +} +details[open] { + padding-bottom: var(--padding); + box-shadow: inset 0 0 0 1px; /*<@r-lyeh*/ + + background-color:transparent; /*<@r-lyeh*/ +} +details > summary { + display: flex; + padding: var(--padding); + margin: 0 calc(var(--padding) * -1); + border-radius: 4px; + /*font-size: 24px;*/ /*<@r-lyeh*/ + cursor: pointer; + justify-content: space-between; + list-style: none; /* Hides the default arrow */ +} +details[open] > summary { + box-shadow: 0 0px; /*4px;*/ /*<@r-lyeh*/ +} +/* Adds an (+) icon when the
is closed... */ +details > summary::after { + content: "⇕"; +} +/* ...and switches it when
is open (-) icon */ +details[open] > summary::after { + content: "⇕"; +} +/* Removes the ugly default arrow on Chrome */ +details > summary::-webkit-details-marker { + display: none; +}