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

fix ugly scrollbars bug #546

Merged
merged 1 commit into from
Nov 11, 2024
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 @@ -374,9 +374,9 @@ const DeltaChart: FC<DeltaChartProps> = ({ className, combinedData, combinedErro
</div>
)}
<div
className={`flex flex-col flex-grow-0 flex-shrink overflow-y-scroll ${
clickedGspId ? "h-[30%]" : "h-[40%]"
}`}
className={`flex flex-col flex-grow-0 flex-shrink${
hasGspPvInitialForSelectedTime ? " overflow-y-scroll" : ""
} ${clickedGspId ? "h-[30%]" : "h-[40%]"}`}
>
<DeltaBuckets bucketSelection={selectedBuckets} gspDeltas={gspDeltas} />
{!hasGspPvInitialForSelectedTime && (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -324,30 +324,30 @@ const SolarSiteChart: FC<{
</div>
)}

<div className="flex-1 flex flex-col overflow-y-scroll relative">
<div className="flex-1 flex flex-col relative">
<AggregatedDataTable
className={`absolute inset-0 overflow-y-scroll pb-16 ${
className={`absolute inset-0 overflow-y-scroll mb-12 ${
currentAggregation(AGGREGATION_LEVELS.NATIONAL) ? "z-10" : "z-0 opacity-0"
}`}
title={"National"}
tableData={Array.from(aggregatedSitesData.national.values())}
/>
<AggregatedDataTable
className={`absolute inset-0 overflow-y-scroll pb-16 ${
className={`absolute inset-0 overflow-y-scroll mb-12 ${
currentAggregation(AGGREGATION_LEVELS.REGION) ? "z-10" : "z-0 opacity-0"
}`}
title={"Region"}
tableData={Array.from(aggregatedSitesData.regions.values())}
/>
<AggregatedDataTable
className={`absolute inset-0 overflow-y-scroll pb-16 ${
className={`absolute inset-0 overflow-y-scroll mb-12 ${
currentAggregation(AGGREGATION_LEVELS.GSP) ? "z-10" : "z-0 opacity-0"
}`}
title={"GSP"}
tableData={Array.from(aggregatedSitesData.gsps.values())}
/>
<AggregatedDataTable
className={`absolute inset-0 overflow-y-scroll pb-16 ${
className={`absolute inset-0 overflow-y-scroll mb-12 ${
currentAggregation(AGGREGATION_LEVELS.SITE) ? "z-10" : "z-0 opacity-0"
}`}
title={"Sites"}
Expand Down
2 changes: 1 addition & 1 deletion apps/nowcasting-app/components/side-layout/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ const SideLayout: FC<SideLayoutProps> = ({
"focus:outline-none h-full text-white justify-between flex flex-col bg-mapbox-black-500 z-20 "
}
>
<div className={`min-h-full max-h-full flex flex-col overflow-y-scroll`}>{children}</div>
<div className={`min-h-full max-h-full flex flex-col`}>{children}</div>
</div>
<div className="absolute bottom-12 -right-4 h-10 z-20">
<ExpandButton isOpen={isOpen} onClick={() => setIsOpen((o) => !o)} />
Expand Down
25 changes: 25 additions & 0 deletions apps/nowcasting-app/styles/globals.css
Original file line number Diff line number Diff line change
Expand Up @@ -114,3 +114,28 @@
overflow: hidden;
visibility: hidden;
}

/**************/
/* SCROLLBARS */
/**************/

/* Works on Firefox */
* {
scrollbar-width: thin;
scrollbar-color: theme(colors.mapbox-black.700) theme(colors.mapbox-black.600);
}

/* Works on Chrome, Edge, and Safari */
*::-webkit-scrollbar {
width: 12px;
}

*::-webkit-scrollbar-track {
background: theme(colors.mapbox-black.600);
}

*::-webkit-scrollbar-thumb {
background-color: theme(colors.mapbox-black.700);
border-radius: 20px;
border: 3px solid theme(colors.mapbox-black.600);
}
Loading