Skip to content

Commit e272645

Browse files
NicolappsConvex, Inc.
authored andcommitted
docs: refactor style for categories that have no category page (#41325)
This makes the code mode obvious by adding a class instead of repeating classes for both `tutorial` and `understand`. Also, it fixes the style of collapsible subitems. GitOrigin-RevId: 5728c0665160d657f75dabe21e95b61626496ec9
1 parent d2e4a34 commit e272645

File tree

2 files changed

+7
-20
lines changed

2 files changed

+7
-20
lines changed

npm-packages/docs/sidebars.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ const sidebars = {
5959
label: "Tutorial",
6060
link: { type: "doc", id: "tutorial/index" },
6161
items: [{ type: "autogenerated", dirName: "tutorial" }],
62-
className: "convex-sidebar-tutorial",
62+
className: "convex-sidebar-tutorial convex-sidebar-no-category-page",
6363
},
6464
{
6565
type: "category",
@@ -73,7 +73,7 @@ const sidebars = {
7373
label: "Understand Convex",
7474
link: { type: "doc", id: "understanding/index" },
7575
items: [{ type: "autogenerated", dirName: "understanding" }],
76-
className: "convex-sidebar-understand",
76+
className: "convex-sidebar-understand convex-sidebar-no-category-page",
7777
},
7878
{
7979
type: "html",

npm-packages/docs/src/css/custom.css

Lines changed: 5 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -724,30 +724,17 @@ ul.menu__list {
724724
display: none;
725725
}
726726

727-
/* Tutorial is special, it forwards to an internal page. Remove all this when we ban section pages. */
728-
.convex-sidebar-tutorial .menu__list-item-collapsible--active {
727+
/* Fix the active state of categories that forward to an internal page in the category. */
728+
.convex-sidebar-no-category-page > .menu__list-item-collapsible--active {
729729
background: var(--ifm-background-color);
730730
}
731-
.convex-sidebar-tutorial .menu__list-item-collapsible--active:hover {
732-
background: var(--ifm-menu-color-background-hover);
733-
}
734-
.convex-sidebar-tutorial
735-
.menu__list-item-collapsible--active
736-
> .menu__link--active {
737-
font-weight: 400;
738-
}
739731

740-
/* Understanding is special, it forwards to an internal page. Remove all this when we ban section pages. */
741-
.convex-sidebar-understand .menu__list-item-collapsible--active {
742-
background: var(--ifm-background-color);
743-
}
744-
745-
.convex-sidebar-understand .menu__list-item-collapsible--active:hover {
732+
.convex-sidebar-no-category-page > .menu__list-item-collapsible--active:hover {
746733
background: var(--ifm-menu-color-background-hover);
747734
}
748735

749-
.convex-sidebar-understand
750-
.menu__list-item-collapsible--active
736+
.convex-sidebar-no-category-page
737+
> .menu__list-item-collapsible--active
751738
> .menu__link--active {
752739
font-weight: 400;
753740
}

0 commit comments

Comments
 (0)