From 2ed4b46a0d532fb8edab3d02a9fc416f53847f01 Mon Sep 17 00:00:00 2001 From: Anish Singh <21U01053@iiitbhopal.ac.in> Date: Mon, 4 Nov 2024 00:36:41 +0530 Subject: [PATCH] feat: Add Sticky Navigation and Custom Scrollbar for Jobs Page (#571) --- src/app/jobs/page.tsx | 39 ++++++++++++++++++++++++--------------- tailwind.config.ts | 32 +++++++++++++++++++++++++++++++- 2 files changed, 55 insertions(+), 16 deletions(-) diff --git a/src/app/jobs/page.tsx b/src/app/jobs/page.tsx index 3dfd3077..5780df3a 100644 --- a/src/app/jobs/page.tsx +++ b/src/app/jobs/page.tsx @@ -17,7 +17,7 @@ const page = async ({ searchParams }: { searchParams: JobQuerySchemaType }) => { } const parsedSearchParams = parsedData.data; return ( -
+

Explore Jobs

@@ -25,22 +25,31 @@ const page = async ({ searchParams }: { searchParams: JobQuerySchemaType }) => { aspirations.

+
-
- +
+
+ +
-
- - - -
- } - > - - + +
+
+ +
+ +
+ + +
+ } + > + + +
diff --git a/tailwind.config.ts b/tailwind.config.ts index 9051a39c..2fd23d72 100644 --- a/tailwind.config.ts +++ b/tailwind.config.ts @@ -1,5 +1,7 @@ import type { Config } from 'tailwindcss'; const { fontFamily } = require('tailwindcss/defaultTheme'); +import plugin from 'tailwindcss/plugin'; + const { default: flattenColorPalette, } = require('tailwindcss/lib/util/flattenColorPalette'); @@ -119,7 +121,35 @@ const config = { }, }, }, - plugins: [require('tailwindcss-animate'), addVariablesForColors], + plugins: [ + require('tailwindcss-animate'), + addVariablesForColors, + plugin(({ addUtilities }) => { + addUtilities({ + '.scrollbar-hide': { + '-ms-overflow-style': 'none', + 'scrollbar-width': 'none', + '&::-webkit-scrollbar': { + display: 'none', + }, + }, + '.scrollbar-custom': { + '&::-webkit-scrollbar': { + width: '12px', + }, + '&::-webkit-scrollbar-thumb': { + backgroundColor: '#1d2839', // Customize thumb color + borderRadius: '6px', + border: '3px solid transparent', // Add space around thumb + backgroundClip: 'content-box', // Adjust thumb size + }, + '&::-webkit-scrollbar-track': { + background: 'transparent', // Hide track + }, + }, + }); + }), + ], } satisfies Config; export default config;