Skip to content

Commit b2972eb

Browse files
authored
Merge pull request #24 from saadman-galib/main
Added custom scrollbar style to LeftSidebar component
2 parents 7f836b5 + 294d98f commit b2972eb

File tree

3 files changed

+22
-4
lines changed

3 files changed

+22
-4
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
.leftsidebar-scrollbar::-webkit-scrollbar {
2+
width: 4px;
3+
}
4+
5+
.leftsidebar-scrollbar::-webkit-scrollbar-track {
6+
background: #18181b;
7+
border-radius: 10px;
8+
}
9+
10+
.leftsidebar-scrollbar::-webkit-scrollbar-thumb {
11+
background: #888;
12+
border-radius: 10px;
13+
}
14+
15+
.leftsidebar-scrollbar::-webkit-scrollbar-thumb:hover {
16+
background: #555;
17+
}

src/components/Homepage/BlogCard/LeftSidebar/LeftSidebar.jsx

+4-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
"use client";
22
import { Button, Card, CardBody, CardHeader } from "@nextui-org/react";
33
import React from "react";
4+
import "./LeftSidebar.css";
45

56
export const LeftSidebar = ({ onCategorySelect, selectedCategory }) => {
67
// category lists
@@ -100,20 +101,20 @@ export const LeftSidebar = ({ onCategorySelect, selectedCategory }) => {
100101
];
101102
return (
102103
<div>
103-
<Card>
104+
<Card className="max-h-[80vh]">
104105
<CardHeader>
105106
<h2 className="text-xl flex justify-center w-full font-bold">
106107
Blog Categories
107108
</h2>
108109
</CardHeader>
109-
110110
<CardBody>
111-
<div className="grid gird-col-1 gap-3 max-h-[400px] overflow-y-auto lg:max-h-none lg:overflow-y-hidden">
111+
<div className="grid gird-col-1 gap-3 max-h-[400px] overflow-y-auto lg:max-h-none leftsidebar-scrollbar">
112112
{catItems?.map((item) => (
113113
<Button
114114
onClick={() => onCategorySelect(item.key)}
115115
variant={selectedCategory === item.key ? "solid" : "light"}
116116
key={item.key}
117+
className="mr-2"
117118
>
118119
{item.label}
119120
</Button>

tailwind.config.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ module.exports = {
4343
background: "#121212", // Main background color, deep dark
4444
primary: "#A3BE8C", // Primary brand color, muted green for accents
4545
secondary: "#4C566A", // Secondary elements, cool gray
46-
accent: "#81A1C1", // Accent color, a calm blue for highlights
46+
accent: "#81A1C1", // Accent color, a calm blue for highlights
4747
},
4848
},
4949
},

0 commit comments

Comments
 (0)