mirror of
https://github.com/facebook/docusaurus.git
synced 2025-04-30 18:58:36 +02:00
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:
parent
da9075105a
commit
cfef4755da
4 changed files with 11 additions and 34 deletions
|
@ -162,8 +162,6 @@ function DocSidebarItemCategory({
|
||||||
className={clsx('menu__link', {
|
className={clsx('menu__link', {
|
||||||
'menu__link--sublist': collapsible && !href,
|
'menu__link--sublist': collapsible && !href,
|
||||||
'menu__link--active': isActive,
|
'menu__link--active': isActive,
|
||||||
[styles.menuLinkText]: !collapsible,
|
|
||||||
[styles.hasHref]: !!hrefWithSSRFallback,
|
|
||||||
})}
|
})}
|
||||||
onClick={
|
onClick={
|
||||||
collapsible
|
collapsible
|
||||||
|
|
|
@ -6,18 +6,6 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@media (min-width: 997px) {
|
@media (min-width: 997px) {
|
||||||
.menuLinkText {
|
|
||||||
cursor: initial;
|
|
||||||
}
|
|
||||||
|
|
||||||
.menuLinkText:hover {
|
|
||||||
background: none;
|
|
||||||
}
|
|
||||||
|
|
||||||
.menuLinkText.hasHref {
|
|
||||||
cursor: pointer;
|
|
||||||
}
|
|
||||||
|
|
||||||
.menuHtmlItem {
|
.menuHtmlItem {
|
||||||
padding: var(--ifm-menu-link-padding-vertical)
|
padding: var(--ifm-menu-link-padding-vertical)
|
||||||
var(--ifm-menu-link-padding-horizontal);
|
var(--ifm-menu-link-padding-horizontal);
|
||||||
|
|
|
@ -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;
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -40,6 +40,15 @@ const sidebars = {
|
||||||
collapsible: false,
|
collapsible: false,
|
||||||
items: ['index', 'more-test'],
|
items: ['index', 'more-test'],
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
type: 'category',
|
||||||
|
label: 'Another category with index',
|
||||||
|
collapsible: false,
|
||||||
|
link: {
|
||||||
|
type: 'generated-index',
|
||||||
|
},
|
||||||
|
items: ['more-test'],
|
||||||
|
},
|
||||||
{
|
{
|
||||||
type: 'category',
|
type: 'category',
|
||||||
label: 'Huge sidebar category',
|
label: 'Huge sidebar category',
|
||||||
|
@ -74,6 +83,8 @@ const sidebars = {
|
||||||
{
|
{
|
||||||
type: 'category',
|
type: 'category',
|
||||||
label: 'HTML items tests',
|
label: 'HTML items tests',
|
||||||
|
collapsed: false,
|
||||||
|
collapsible: false,
|
||||||
items: [
|
items: [
|
||||||
// title
|
// title
|
||||||
{
|
{
|
||||||
|
|
Loading…
Add table
Reference in a new issue