Skip to content

Commit 7072cbb

Browse files
authored
[ENG-481] Fix styling for setting scrolling (#237)
* fix styling * adress PR comments * fix padding issues
1 parent d64ca6f commit 7072cbb

1 file changed

Lines changed: 35 additions & 6 deletions

File tree

apps/roam/src/components/settings/Settings.tsx

Lines changed: 35 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,13 @@ import { FeedbackWidget } from "~/components/BirdEatsBugs";
2828

2929
type SectionHeaderProps = {
3030
children: React.ReactNode;
31+
className?: string;
3132
};
32-
const SectionHeader = ({ children }: SectionHeaderProps) => {
33+
const SectionHeader = ({ children, className }: SectionHeaderProps) => {
3334
return (
34-
<div className="bp3-tab-copy mt-4 cursor-default select-none font-bold">
35+
<div
36+
className={`bp3-tab-copy mt-4 cursor-default select-none font-bold ${className}`}
37+
>
3538
{children}
3639
</div>
3740
);
@@ -93,15 +96,41 @@ export const SettingsDialog = ({
9396
className="relative bg-white"
9497
>
9598
<div className={Classes.DIALOG_BODY}>
99+
<style>{`
100+
.dg-settings-tabs .bp3-tab-list {
101+
overflow-y: auto;
102+
max-height: 100%;
103+
/* Firefox */
104+
scrollbar-width: thin;
105+
scrollbar-color: rgba(0, 0, 0, 0.2) transparent;
106+
/* Webkit browsers */
107+
&::-webkit-scrollbar {
108+
width: 6px;
109+
}
110+
&::-webkit-scrollbar-track {
111+
background: transparent;
112+
}
113+
&::-webkit-scrollbar-thumb {
114+
background-color: rgba(0, 0, 0, 0.2);
115+
border-radius: 3px;
116+
}
117+
}
118+
119+
/* Override bp3-tab-copy font-size when text-lg is applied */
120+
.bp3-tab-copy.text-lg {
121+
font-size: 1.125rem;
122+
}
123+
`}</style>
96124
<Tabs
125+
className="dg-settings-tabs flex h-full"
97126
onChange={(id) => setSelectedTabId(id)}
98127
selectedTabId={selectedTabId}
99128
vertical={true}
100129
renderActiveTabPanelOnly={true}
101130
>
102-
<div className="mb-2 text-lg font-semibold text-neutral-dark">
131+
<SectionHeader className="text-lg font-semibold text-neutral-dark">
103132
Personal Settings
104-
</div>
133+
</SectionHeader>
105134
<Tab
106135
id="discourse-graph-home-personal"
107136
title="Home"
@@ -114,9 +143,9 @@ export const SettingsDialog = ({
114143
className="mb-8 overflow-y-auto"
115144
panel={<QuerySettings extensionAPI={extensionAPI} />}
116145
/>
117-
<div className="text-lg font-semibold text-neutral-dark">
146+
<SectionHeader className="text-lg font-semibold text-neutral-dark">
118147
Global Settings
119-
</div>
148+
</SectionHeader>
120149
<Tab
121150
id="discourse-graph-home"
122151
title="Home"

0 commit comments

Comments
 (0)