diff --git a/docs/docs.css b/docs/docs.css index a38ce5b..74793c9 100644 --- a/docs/docs.css +++ b/docs/docs.css @@ -102,6 +102,10 @@ summary { display: inline; } +summary::-webkit-details-marker { + display: none; +} + details[open] summary { margin-bottom: 8px; } diff --git a/docs/index.html.ejs b/docs/index.html.ejs index 7ca9d5e..c7990cc 100644 --- a/docs/index.html.ejs +++ b/docs/index.html.ejs @@ -586,6 +586,10 @@ (no class needed on these). This will provide them with a nice dotted border and indentation to illustrate the structure of the tree.

+

+ To create expandable sections, wrap child lists inside of + details elements. +

<%- example(`
  • - JavaScript - +
    + JavaScript + +
  • HTML
  • Special Thanks
  • diff --git a/style.css b/style.css index 4ab2927..d3fd909 100644 --- a/style.css +++ b/style.css @@ -488,6 +488,38 @@ ul.tree-view ul > li:last-child::after { background: var(--button-highlight); } +ul.tree-view details { + margin-top: 0; +} + +ul.tree-view details[open] summary { + margin-bottom: 0; +} + +ul.tree-view ul details > summary:before { + margin-left: -22px; + position: relative; + z-index: 1; +} + +ul.tree-view details > summary:before { + text-align: center; + display: block; + float: left; + content: '+'; + border: 1px solid #808080; + width: 8px; + height: 9px; + line-height: 9px; + margin-right: 5px; + padding-left: 1px; + background-color: #fff; +} + +ul.tree-view details[open] > summary:before { + content: '-' +} + pre { display: block; background: var(--button-highlight);