Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 6 commits into from
Feb 11, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,6 @@
*/

@media (min-width: 997px) {
.menuLinkText {
cursor: initial;
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If the href attribute is missing in a link, the default cursor is used, so there is no need for this class.

}

.menuLinkText:hover {
background: none;
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also, we don't need this CSS class after introducing menu__list-item-collapsible.

}

.menuLinkText.hasHref {
cursor: pointer;
}

.menuHtmlItem {
padding: var(--ifm-menu-link-padding-vertical)
var(--ifm-menu-link-padding-horizontal);
Expand Down

This file was deleted.

11 changes: 11 additions & 0 deletions website/_dogfooding/docs-tests-sidebars.js
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down Expand Up @@ -74,6 +83,8 @@ const sidebars = {
{
type: 'category',
label: 'HTML items tests',
collapsed: false,
collapsible: false,
items: [
// title
{
Expand Down