Skip to content

Commit dbef5b3

Browse files
authored
fix docs sidebar styling (#1415)
1 parent 3ff5a0e commit dbef5b3

File tree

1 file changed

+16
-14
lines changed

1 file changed

+16
-14
lines changed

pcweb/components/docpage/sidebar/sidebar.py

Lines changed: 16 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -5,17 +5,16 @@
55
import reflex as rx
66

77
from pcweb.components.docpage.navbar.state import NavbarState
8+
from pcweb.constants import ENTERPRISE_DOCS_URL
89
from pcweb.styles.colors import c_color
10+
911
from .sidebar_items.ai import ai_builder_overview_items
10-
from .sidebar_items.component_lib import (
11-
component_lib,
12-
graphing_libs,
13-
)
14-
from .sidebar_items.learn import learn, frontend, backend, hosting, cli_ref
12+
from .sidebar_items.component_lib import component_lib, graphing_libs
13+
from .sidebar_items.learn import backend, cli_ref, frontend, hosting, learn
1514
from .sidebar_items.recipes import recipes
1615
from .sidebar_items.reference import api_reference
17-
from .state import SidebarState, SideBarItem, SideBarBase
18-
from pcweb.constants import ENTERPRISE_DOCS_URL
16+
from .state import SideBarBase, SideBarItem, SidebarState
17+
1918

2019
def sidebar_link(*children, **props):
2120
"""Create a sidebar link that closes the sidebar when clicked."""
@@ -60,6 +59,7 @@ def sidebar_leaf(
6059
value=item_index,
6160
border="none",
6261
width="100%",
62+
class_name="!overflow-visible",
6363
)
6464
if item.outer
6565
else rx.accordion.item(
@@ -93,6 +93,7 @@ def sidebar_leaf(
9393
border="none",
9494
value=item_index,
9595
width="100%",
96+
class_name="!overflow-visible",
9697
)
9798
)
9899

@@ -150,7 +151,7 @@ def sidebar_item_comp(
150151
),
151152
rx.box(class_name="flex-grow"),
152153
rx.accordion.icon(class_name="size-4"),
153-
class_name="flex items-center !bg-transparent !hover:bg-transparent !py-2 !pr-0 w-full text-slate-9 aria-expanded:text-slate-11 hover:text-slate-11 transition-color",
154+
class_name="!px-0 flex items-center !bg-transparent !hover:bg-transparent !py-2 !pr-0 w-full text-slate-9 aria-expanded:text-slate-11 hover:text-slate-11 transition-color",
154155
),
155156
),
156157
rx.accordion.content(
@@ -167,12 +168,12 @@ def sidebar_item_comp(
167168
type="multiple",
168169
collapsible=True,
169170
default_value=index[:1].foreach(lambda x: "index" + x.to_string()),
170-
class_name="!my-2 flex flex-col items-start gap-4 !ml-[10px] list-none [box-shadow:inset_1.25px_0_0_0_var(--c-slate-4)]",
171+
class_name="!my-2 flex flex-col items-start gap-4 !ml-[10px] list-none [box-shadow:inset_1.25px_0_0_0_var(--c-slate-4)_!important] !bg-transparent",
171172
),
172-
class_name="!p-0 w-full",
173+
class_name="!p-0 w-full !bg-transparent before:!h-0 after:!h-0",
173174
),
174175
value=item_index,
175-
class_name="border-none w-full",
176+
class_name="border-none w-full !bg-transparent",
176177
)
177178
)
178179

@@ -327,7 +328,7 @@ def create_sidebar_section(
327328
type="multiple",
328329
collapsible=True,
329330
default_value=index[:1].foreach(lambda x: "index" + x.to_string()),
330-
class_name="ml-0 pl-0 w-full",
331+
class_name="ml-0 pl-0 w-full !bg-transparent",
331332
),
332333
class_name="flex flex-col items-start ml-0 w-full",
333334
)
@@ -350,13 +351,14 @@ def sidebar_comp(
350351
tutorials_index: list[int],
351352
width: str = "100%",
352353
):
353-
from pcweb.pages.docs import enterprise, getting_started, state, ui
354+
from pcweb.pages.docs import ai_builder as ai_builder_pages
355+
from pcweb.pages.docs import enterprise, getting_started
354356
from pcweb.pages.docs import hosting as hosting_page
357+
from pcweb.pages.docs import state, ui
355358
from pcweb.pages.docs.apiref import pages
356359
from pcweb.pages.docs.custom_components import custom_components
357360
from pcweb.pages.docs.library import library
358361
from pcweb.pages.docs.recipes_overview import overview
359-
from pcweb.pages.docs import ai_builder as ai_builder_pages
360362

361363
return rx.box( # pyright: ignore [reportCallIssue]
362364
# Handle sidebar categories for docs/cloud first

0 commit comments

Comments
 (0)