From c198d4305c7feb5fce1a8b743140d07051686fd5 Mon Sep 17 00:00:00 2001 From: Sami Ahmed Siddiqui Date: Tue, 10 Jan 2023 23:43:49 +0500 Subject: [PATCH] [docs] use current version as title in version selector (#15604) Co-authored-by: Alex Ball --- ...sion_dropdown.scss => _dropdown_list.scss} | 65 ++++++++----------- docs/assets/scss/_nav.scss | 4 -- docs/assets/scss/_styles_project.scss | 11 +++- docs/layouts/_default/content.html | 7 -- docs/layouts/indexpage/list.html | 7 -- docs/layouts/partials/contribute_list.html | 2 +- .../partials/navbar-version-selector.html | 18 ++++- docs/layouts/partials/navbar.html | 2 +- docs/layouts/partials/sidebar-tree.html | 4 +- docs/src/index.js | 13 ---- 10 files changed, 56 insertions(+), 77 deletions(-) rename docs/assets/scss/{_version_dropdown.scss => _dropdown_list.scss} (88%) diff --git a/docs/assets/scss/_version_dropdown.scss b/docs/assets/scss/_dropdown_list.scss similarity index 88% rename from docs/assets/scss/_version_dropdown.scss rename to docs/assets/scss/_dropdown_list.scss index 07dbce029215..a8ff50d35709 100644 --- a/docs/assets/scss/_version_dropdown.scss +++ b/docs/assets/scss/_dropdown_list.scss @@ -1,5 +1,4 @@ -#contribute-list, -.main-heading-with-version { +.dropdown-list { display: flex; align-items: center; justify-content: space-between; @@ -8,21 +7,24 @@ margin: 20px 0; } - &.header-version-dropdown { - margin: 0; + .dropdown-menu { + background: #fff; + border: 1px solid #d7dee4; + box-shadow: 0 1px 4px rgba(153, 153, 153, 0.5); + border-radius: 8px; + padding: 8px 0; + margin-top: 1px; - ul { - margin: 0 0 5px 0; + .dropdown-item { + font-size: 13px; + line-height: 16px; + color: $yb-font-dark; + padding: 8px 16px; - .dropdown-toggle { - padding: 5px 12px; + &:hover { + background: #f2f6ff !important; } } - - .dropdown-menu { - right: 0; - left: initial; - } } .dropdown-toggle { @@ -50,9 +52,7 @@ font-size: 10px; line-height: 16px; text-transform: uppercase; - //color: #4e5f6d; height: 20px; - //background: #e9eef2; border-radius: 4px; padding: 2px 6px; margin-left: 6px; @@ -70,37 +70,24 @@ } } - .dropdown-menu { - background: #fff; - border: 1px solid #d7dee4; - box-shadow: 0 1px 4px rgba(153, 153, 153, 0.5); - border-radius: 8px; - padding: 8px 0; - margin-top: 1px; + &.header-version-dropdown { + margin: 0; - .dropdown-item { - font-size: 13px; - line-height: 16px; - color: $yb-font-dark; - padding: 8px 16px; + ul { + margin: 0 0 5px 0; - &:hover { - background: #f2f6ff !important; + .dropdown-toggle { + padding: 5px 12px; } + } - &:hover { - background: transparent; - } + .dropdown-menu { + right: 0; + left: initial; } } -} - -.heading-content .navbar-nav { - display: none; -} -.main-heading-with-version { - &.dd-chang-showmobile { + &.dd-change-showmobile { display: flex; margin: 20px 0 0 32px; width: calc(100% - 49px); diff --git a/docs/assets/scss/_nav.scss b/docs/assets/scss/_nav.scss index e772968bc196..11fec9b4ff47 100644 --- a/docs/assets/scss/_nav.scss +++ b/docs/assets/scss/_nav.scss @@ -400,10 +400,6 @@ body { display: block; } - .main-heading-with-version { - display: none; - } - @media (max-width: 767px) { &::after { background-color: #eee; diff --git a/docs/assets/scss/_styles_project.scss b/docs/assets/scss/_styles_project.scss index f0020495b80f..a6c9d39a561d 100644 --- a/docs/assets/scss/_styles_project.scss +++ b/docs/assets/scss/_styles_project.scss @@ -1,6 +1,6 @@ @import "./_yb_headings.scss"; @import "./_yb_bullets-and-number-list.scss"; -@import "./_version_dropdown.scss"; +@import "./_dropdown_list.scss"; @import "./_contribute_list.scss"; @import "./_admonition.scss"; @import "./_code_block.scss"; @@ -373,10 +373,17 @@ body:not(.td-home) .td-main main { .main-heading-with-version { margin-top: 16px; + display: flex; + align-items: center; + justify-content: space-between; @media (max-width: 991px) { margin-top: 0; } + + @media (min-width: 991px) { + margin: 20px 0; + } } } @@ -398,7 +405,7 @@ body:not(.td-home) .td-main main { } @media (max-width: 767px) { - .main-heading-with-version { + .td-content .main-heading-with-version { display: flex; align-items: flex-start; justify-content: flex-start; diff --git a/docs/layouts/_default/content.html b/docs/layouts/_default/content.html index c4349bf0c3ed..9f6bfdf515b9 100644 --- a/docs/layouts/_default/content.html +++ b/docs/layouts/_default/content.html @@ -5,13 +5,6 @@

{{ if .Params.headerTitle }}{{ .Params.headerTitle }}{{ else }}{{ .Title }}{{ end }} {{ if .Draft }} (Draft){{ end }}{{ if .Params.beta }}Beta{{ end }}

{{ with .Params.headcontent }}
{{ . | markdownify }}
{{ end }} - {{ if and .Site.Params.versions (not .Params.unversioned) }} - - {{ end }} diff --git a/docs/layouts/indexpage/list.html b/docs/layouts/indexpage/list.html index e7f90bc480d0..845af2e3d1ae 100644 --- a/docs/layouts/indexpage/list.html +++ b/docs/layouts/indexpage/list.html @@ -22,13 +22,6 @@

{{ if .Params.headerTitle }}{{ .Params.headerTitle }}{{ else }}{{ .Title }}{{ end }} {{ if .Draft }} (Draft){{ end }}{{ if .Params.beta }}Beta{{ end }}

{{ with .Params.headcontent }}
{{ . | markdownify }}
{{ end }} - {{ if and .Site.Params.versions (not .Params.unversioned) }} - - {{ end }} {{ partial "contribute_list" . }} diff --git a/docs/layouts/partials/contribute_list.html b/docs/layouts/partials/contribute_list.html index 125c5392db0d..8e57bae57281 100644 --- a/docs/layouts/partials/contribute_list.html +++ b/docs/layouts/partials/contribute_list.html @@ -1,4 +1,4 @@ -