From 5ffedabb070a16df14032960035a349a3ab327b8 Mon Sep 17 00:00:00 2001 From: Jeremy Thomas Date: Mon, 9 Apr 2018 17:59:04 +0100 Subject: [PATCH] Add docs menu --- docs/_data/links.json | 2 +- docs/_layouts/documentation.html | 36 +++++++++++++++++++-- docs/_sass/main.sass | 40 ++++++++++++++++++++++- docs/css/bulma-docs.css | 54 ++++++++++++++++++++++++++++++-- 4 files changed, 125 insertions(+), 7 deletions(-) diff --git a/docs/_data/links.json b/docs/_data/links.json index 16512a1d..3469a7bd 100644 --- a/docs/_data/links.json +++ b/docs/_data/links.json @@ -249,7 +249,7 @@ "path": "/documentation/components/tabs" } }, - "order": { + "categories": { "overview": ["overview-start", "overview-classes", "overview-modular", "overview-responsiveness", "overview-variables", "overview-colors", "overview-functions", "overview-mixins"], "columns": ["columns-basics", "columns-sizes", "columns-responsiveness", "columns-nesting", "columns-gap", "columns-options"], "modifiers": ["modifiers-syntax", "modifiers-helpers", "modifiers-responsive-helpers", "modifiers-color-helpers", "modifiers-typography-helpers"], diff --git a/docs/_layouts/documentation.html b/docs/_layouts/documentation.html index 07626370..68434cc9 100644 --- a/docs/_layouts/documentation.html +++ b/docs/_layouts/documentation.html @@ -5,8 +5,9 @@ route: documentation {% include navbar.html id="Documentation" %} +{% assign current_category = page.doc-tab %} {% assign current_link_id = page.breadcrumb | last %} -{% assign category_links = site.data.links.order[page.doc-tab] %} +{% assign category_links = site.data.links.categories[current_category] %} {% for link_id in category_links %} {% if link_id == current_link_id %} @@ -98,9 +99,38 @@ route: documentation diff --git a/docs/_sass/main.sass b/docs/_sass/main.sass index 06dcb8e1..7da720cc 100644 --- a/docs/_sass/main.sass +++ b/docs/_sass/main.sass @@ -66,6 +66,44 @@ $main-spacing: 2.5rem right: 0 top: 0 +.bd-category + a + &:hover + color: $link + &:not(:last-child) + margin-bottom: 0.5rem + +.bd-category-header + position: relative + +.bd-category-toggle + +overlay + align-items: center + color: $grey-light + display: flex + justify-content: flex-end + .icon + font-size: 0.75rem + +.bd-category-name + color: $text-strong + position: relative + +.bd-category-list + display: none + font-size: 0.875rem + padding: 0.5rem + li + &:not(:last-child) + margin-bottom: 0.5em + &.is-current + a + color: $link + a + color: $text-light + &.is-active + display: block + +touch .bd-lead, .bd-side @@ -77,7 +115,7 @@ $main-spacing: 2.5rem .bd-side-background display: none -$sidebar-width: 16rem +$sidebar-width: 14rem +tablet .bd-duo diff --git a/docs/css/bulma-docs.css b/docs/css/bulma-docs.css index d6c93d40..47bbf03d 100644 --- a/docs/css/bulma-docs.css +++ b/docs/css/bulma-docs.css @@ -130,7 +130,7 @@ width: 1em; } -.is-overlay, .image.is-square img, .image.is-1by1 img, .image.is-5by4 img, .image.is-4by3 img, .image.is-3by2 img, .image.is-5by3 img, .image.is-16by9 img, .image.is-2by1 img, .image.is-3by1 img, .image.is-4by5 img, .image.is-3by4 img, .image.is-2by3 img, .image.is-3by5 img, .image.is-9by16 img, .image.is-1by2 img, .image.is-1by3 img, .modal, .modal-background, .hero-video, .intro-spinner, .intro-shadow, .bd-article-overlay, .bd-article-icon, +.is-overlay, .image.is-square img, .image.is-1by1 img, .image.is-5by4 img, .image.is-4by3 img, .image.is-3by2 img, .image.is-5by3 img, .image.is-16by9 img, .image.is-2by1 img, .image.is-3by1 img, .image.is-4by5 img, .image.is-3by4 img, .image.is-2by3 img, .image.is-3by5 img, .image.is-9by16 img, .image.is-1by2 img, .image.is-1by3 img, .modal, .modal-background, .hero-video, .bd-category-toggle, .intro-spinner, .intro-shadow, .bd-article-overlay, .bd-article-icon, .bd-article-info, .bd-structure-item::before, .bd-structure-item::after, .highlight .bd-show, .bd-banner-background, .bd-book-pattern::before, .bd-book-modal-column.bd-is-cover::before, .bd-book-pattern, .bd-book-modal-background { bottom: 0; @@ -9570,6 +9570,56 @@ label.panel-block:hover { top: 0; } +.bd-category a:hover { + color: #3273dc; +} + +.bd-category:not(:last-child) { + margin-bottom: 0.5rem; +} + +.bd-category-header { + position: relative; +} + +.bd-category-toggle { + align-items: center; + color: #b5b5b5; + display: flex; + justify-content: flex-end; +} + +.bd-category-toggle .icon { + font-size: 0.75rem; +} + +.bd-category-name { + color: #363636; + position: relative; +} + +.bd-category-list { + display: none; + font-size: 0.875rem; + padding: 0.5rem; +} + +.bd-category-list li:not(:last-child) { + margin-bottom: 0.5em; +} + +.bd-category-list li.is-current a { + color: #3273dc; +} + +.bd-category-list a { + color: #7a7a7a; +} + +.bd-category-list.is-active { + display: block; +} + @media screen and (max-width: 1023px) { .bd-lead, .bd-side { @@ -9600,7 +9650,7 @@ label.panel-block:hover { display: flex; } .bd-side { - flex: 0 0 calc(16rem + 1.5rem); + flex: 0 0 calc(14rem + 1.5rem); } }