Skip to content

Commit

Permalink
feat: add gradient prop to update fades
Browse files Browse the repository at this point in the history
  • Loading branch information
steveoh committed Mar 21, 2024
1 parent 0f3050c commit ffeab7e
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 5 deletions.
19 changes: 16 additions & 3 deletions src/components/data/BreadCrumbs.astro
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,27 @@ interface Props {
product?: string;
category: SgidCategory | string;
class?: string;
gradients?: string;
}
const { product, category, class: className } = Astro.props;
const { product, category, class: className, gradients = 'from-white dark:from-primary-950' } = Astro.props;
---

<nav class:list={['relative flex flex-col items-center justify-center gap-2 pl-2', className]}>
<div class="absolute left-0 z-10 h-full w-5 bg-gradient-to-r from-white to-transparent dark:from-primary-950"></div>
<div class="absolute right-0 z-10 h-full w-5 bg-gradient-to-l from-white to-transparent dark:from-primary-950"></div>
<div
class:list={[
'absolute left-0 z-10 h-full w-5 bg-gradient-to-r from-white to-transparent lg:hidden dark:from-primary-950',
gradients,
]}
>
</div>
<div
class:list={[
'absolute right-0 z-10 h-full w-5 bg-gradient-to-l from-white to-transparent lg:hidden dark:from-primary-950',
gradients,
]}
>
</div>
<ol
class="flex w-full gap-2 overflow-x-auto [-ms-overflow-style:-ms-autohiding-scrollbar] [-webkit-overflow-scrolling:touch] [scrollbar-width:none] [&::-webkit-scrollbar]:hidden"
>
Expand Down
8 changes: 6 additions & 2 deletions src/pages/products/sgid/[category].astro
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ export async function getStaticPaths() {
const pages = (await Astro.glob<IDataCategory>('../**/*.astro'))
.filter((page) => {
return [page.metadata?.category?.toLowerCase(), page?.metadata?.secondaryCategory?.toLowerCase()].includes(
categoryString,
categoryString
);
})
.sort((a, b) => a.metadata.pageTitle.localeCompare(b.metadata.pageTitle));
Expand All @@ -60,7 +60,11 @@ const page: IStandardPageMetadata = {
---

<Layout {...page}>
<BreadCrumbs category={toEnum(category)} class="bg-zinc-100 dark:bg-zinc-900 dark:text-zinc-300" />
<BreadCrumbs
category={toEnum(category)}
class="bg-zinc-100 dark:bg-zinc-900 dark:text-zinc-300"
gradients="from-zinc-100 dark:from-zinc-950"
/>
<Section {...page.section[0]}>
{
pages.map((page) => (
Expand Down

0 comments on commit ffeab7e

Please sign in to comment.