From 250401dc74c335d15fa50a389010696920c6ad9e Mon Sep 17 00:00:00 2001 From: Alexey Pyltsyn Date: Sun, 6 Feb 2022 19:35:33 +0300 Subject: [PATCH 1/5] refactor(theme-classic): clean up doc sidebar item CSS --- .../src/theme/DocSidebarItem/index.tsx | 2 -- .../theme/DocSidebarItem/styles.module.css | 12 ----------- .../theme/DocSidebarItems/styles.module.css | 20 ------------------- website/sidebars.js | 1 + 4 files changed, 1 insertion(+), 34 deletions(-) delete mode 100644 packages/docusaurus-theme-classic/src/theme/DocSidebarItems/styles.module.css diff --git a/packages/docusaurus-theme-classic/src/theme/DocSidebarItem/index.tsx b/packages/docusaurus-theme-classic/src/theme/DocSidebarItem/index.tsx index 462ebc12e9b7..f92868686945 100644 --- a/packages/docusaurus-theme-classic/src/theme/DocSidebarItem/index.tsx +++ b/packages/docusaurus-theme-classic/src/theme/DocSidebarItem/index.tsx @@ -162,8 +162,6 @@ function DocSidebarItemCategory({ className={clsx('menu__link', { 'menu__link--sublist': collapsible && !href, 'menu__link--active': isActive, - [styles.menuLinkText]: !collapsible, - [styles.hasHref]: !!hrefWithSSRFallback, })} onClick={ collapsible diff --git a/packages/docusaurus-theme-classic/src/theme/DocSidebarItem/styles.module.css b/packages/docusaurus-theme-classic/src/theme/DocSidebarItem/styles.module.css index 0d397f8170da..2bb6934d33ee 100644 --- a/packages/docusaurus-theme-classic/src/theme/DocSidebarItem/styles.module.css +++ b/packages/docusaurus-theme-classic/src/theme/DocSidebarItem/styles.module.css @@ -6,18 +6,6 @@ */ @media (min-width: 997px) { - .menuLinkText { - cursor: initial; - } - - .menuLinkText:hover { - background: none; - } - - .menuLinkText.hasHref { - cursor: pointer; - } - .menuHtmlItem { padding: var(--ifm-menu-link-padding-vertical) var(--ifm-menu-link-padding-horizontal); diff --git a/packages/docusaurus-theme-classic/src/theme/DocSidebarItems/styles.module.css b/packages/docusaurus-theme-classic/src/theme/DocSidebarItems/styles.module.css deleted file mode 100644 index e197c843f82a..000000000000 --- a/packages/docusaurus-theme-classic/src/theme/DocSidebarItems/styles.module.css +++ /dev/null @@ -1,20 +0,0 @@ -/** - * Copyright (c) Facebook, Inc. and its affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */ - -@media (min-width: 997px) { - .menuLinkText { - cursor: initial; - } - - .menuLinkText:hover { - background: none; - } - - .menuLinkText.hasHref { - cursor: pointer; - } -} diff --git a/website/sidebars.js b/website/sidebars.js index 596b26f819a8..f42901e6ea73 100644 --- a/website/sidebars.js +++ b/website/sidebars.js @@ -18,6 +18,7 @@ const sidebars = { type: 'generated-index', }, collapsed: false, + collapsible: false, items: [ 'installation', 'configuration', From 89766e009e6a186227ad43cbf4abe5da0c698aa7 Mon Sep 17 00:00:00 2001 From: Alexey Pyltsyn Date: Sun, 6 Feb 2022 20:11:34 +0300 Subject: [PATCH 2/5] Use link placeholder for Introduction category --- website/sidebars.js | 3 --- 1 file changed, 3 deletions(-) diff --git a/website/sidebars.js b/website/sidebars.js index f42901e6ea73..f652bcb658d1 100644 --- a/website/sidebars.js +++ b/website/sidebars.js @@ -14,9 +14,6 @@ const sidebars = { { type: 'category', label: 'Getting Started', - link: { - type: 'generated-index', - }, collapsed: false, collapsible: false, items: [ From d09ea2923b60298bd92c1ce82b39a25d985913d7 Mon Sep 17 00:00:00 2001 From: Alexey Pyltsyn Date: Thu, 10 Feb 2022 01:28:55 +0300 Subject: [PATCH 3/5] Use test pages for dogfooding --- website/_dogfooding/docs-tests-sidebars.js | 2 ++ website/sidebars.js | 2 -- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/website/_dogfooding/docs-tests-sidebars.js b/website/_dogfooding/docs-tests-sidebars.js index ec54a32d027b..9258868a3079 100644 --- a/website/_dogfooding/docs-tests-sidebars.js +++ b/website/_dogfooding/docs-tests-sidebars.js @@ -74,6 +74,8 @@ const sidebars = { { type: 'category', label: 'HTML items tests', + collapsed: false, + collapsible: false, items: [ // title { diff --git a/website/sidebars.js b/website/sidebars.js index f652bcb658d1..4090bb26491f 100644 --- a/website/sidebars.js +++ b/website/sidebars.js @@ -14,8 +14,6 @@ const sidebars = { { type: 'category', label: 'Getting Started', - collapsed: false, - collapsible: false, items: [ 'installation', 'configuration', From 38477b5bc22e47cc55f53041c1aecbe59d07db54 Mon Sep 17 00:00:00 2001 From: Alexey Pyltsyn Date: Thu, 10 Feb 2022 11:22:44 +0300 Subject: [PATCH 4/5] Update sidebars.js --- website/sidebars.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/website/sidebars.js b/website/sidebars.js index 4090bb26491f..596b26f819a8 100644 --- a/website/sidebars.js +++ b/website/sidebars.js @@ -14,6 +14,10 @@ const sidebars = { { type: 'category', label: 'Getting Started', + link: { + type: 'generated-index', + }, + collapsed: false, items: [ 'installation', 'configuration', From 6daf75fefecece2851f3bcf33978f8d04b6767d5 Mon Sep 17 00:00:00 2001 From: Alexey Pyltsyn Date: Fri, 11 Feb 2022 00:00:32 +0300 Subject: [PATCH 5/5] Add another test case --- website/_dogfooding/docs-tests-sidebars.js | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/website/_dogfooding/docs-tests-sidebars.js b/website/_dogfooding/docs-tests-sidebars.js index 9258868a3079..804301319943 100644 --- a/website/_dogfooding/docs-tests-sidebars.js +++ b/website/_dogfooding/docs-tests-sidebars.js @@ -40,6 +40,15 @@ const sidebars = { collapsible: false, items: ['index', 'more-test'], }, + { + type: 'category', + label: 'Another category with index', + collapsible: false, + link: { + type: 'generated-index', + }, + items: ['more-test'], + }, { type: 'category', label: 'Huge sidebar category',