refactor(theme-classic): clean up CSS of doc sidebar item (#6622)

* refactor(theme-classic): clean up doc sidebar item CSS

* Use link placeholder for Introduction category

* Use test pages for dogfooding

* Update sidebars.js

* Add another test case
This commit is contained in:
Alexey Pyltsyn 2022-02-11 08:11:47 +03:00 committed by GitHub
parent da9075105a
commit cfef4755da
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 11 additions and 34 deletions

View file

@ -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

View file

@ -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);

View file

@ -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;
}
}

View file

@ -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',
@ -74,6 +83,8 @@ const sidebars = {
{
type: 'category',
label: 'HTML items tests',
collapsed: false,
collapsible: false,
items: [
// title
{