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

Feature/sidebar shadow #29

Merged
merged 9 commits into from
Sep 27, 2023
10 changes: 9 additions & 1 deletion src/app/globals.css
Dan-Y-Ko marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,12 @@

::-webkit-scrollbar-thumb:hover {
background: #C0C0C0;
}
}

.sidebar-shadow-light {
box-shadow: 8px 0 10px -5px var(--neutral-focus);
}

.sidebar-shadow-dark {
box-shadow: 8px 0 10px -5px var(--neutral-focus);
}
8 changes: 7 additions & 1 deletion src/components/sidebar/Sidebar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import {
BookmarkSquareIcon,
RocketLaunchIcon,
} from "@heroicons/react/24/solid";
import { useTheme } from "next-themes";
import PageButton from "./PageButton";
import VoyagePageButton from "./VoyagePageButton";
import VoyageStatus from "./VoyageStatus";
Expand Down Expand Up @@ -106,6 +107,7 @@ const voyageData = {

export default function Sidebar() {
const currentPath = usePathname();
const { theme } = useTheme();

const [isOpenSidebar, setIsOpenSidebar] = useState<boolean>(true);
const [selectedButton, setSelectedButton] = useState<string>(currentPath);
Expand All @@ -123,11 +125,15 @@ export default function Sidebar() {
}
};

const isDark = theme === "dark";

return (
<aside
className={`sticky top-16 h-[calc(100vh-theme(spacing.16))] ${
isOpenSidebar ? "w-[18.4375rem]" : "w-[5.8125rem]"
} text-center bg-base-200 flex flex-col justify-between`}
} text-center bg-base-200 flex flex-col justify-between ${
isDark ? "sidebar-shadow-dark" : "sidebar-shadow-light"
}`}
>
<ul
className={`flex flex-col ${
Expand Down
10 changes: 8 additions & 2 deletions tailwind.config.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
/** @type {import('tailwindcss').Config} */

const NEUTRAL_FOCUS_LIGHT = "#4C515B";
const NEUTRAL_FOCUS_DARK = "#A0A5AE";

module.exports = {
content: [
"./src/components/**/*.{js,ts,jsx,tsx,mdx}",
Expand All @@ -19,7 +23,7 @@ module.exports = {
"accent-focus": "#98DDBD",
"accent-content": "#D7EDE3",
neutral: "#6B7280",
"neutral-focus": "#4C515B",
"neutral-focus": NEUTRAL_FOCUS_LIGHT,
"neutral-content": "#9CA1AA",
info: "#8FC4E5",
"info-content": "#DCEDF7",
Expand All @@ -33,6 +37,7 @@ module.exports = {
"base-200": "#F5F5F5",
"base-300": "#16171A",
"base-content": "#EEEFF0",
"--neutral-focus": NEUTRAL_FOCUS_LIGHT,
},
},
{
Expand All @@ -47,7 +52,7 @@ module.exports = {
"accent-focus": "#6EE7B7",
"accent-content": "#6B9984",
neutral: "#6B7280",
"neutral-focus": "#A0A5AE",
"neutral-focus": NEUTRAL_FOCUS_DARK,
"neutral-content": "#3B3F46",
info: "#84B5D4",
"info-content": "#668BA3",
Expand All @@ -61,6 +66,7 @@ module.exports = {
"base-200": "#16171A",
"base-300": "#F5F5F5",
"base-content": "#2D3036",
"--neutral-focus": NEUTRAL_FOCUS_DARK,
},
},
],
Expand Down
Loading