Skip to content

Commit

Permalink
Merge pull request #64 from yanosea/61-change-header-to-sticky
Browse files Browse the repository at this point in the history
✨feat: change header to sticky
  • Loading branch information
yanosea authored May 8, 2024
2 parents b602355 + 8fbe0db commit 40400a1
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 8 deletions.
8 changes: 6 additions & 2 deletions front/src/components/Header.astro
Original file line number Diff line number Diff line change
@@ -1,11 +1,15 @@
---
import IconLink from "@/components/IconLink.astro";
import MainLinks from "@/components//MainLinks.astro";
const { borderVisible = false } = Astro.props;
---

<div class="flex sticky bottom-[100vh] w-full justify-between px-6 py-6">
<div
class={`flex sticky top-0 w-full justify-between bg-background dark:bg-background-dark ${borderVisible ? "border-b border-gray dark:border-gray-dark" : ""} px-6 py-6 z-10`}
>
<IconLink icon="ri:home-4-fill" href="/" />
<div class="flex flex-row items-center space-x-4">
<div class="flex flex-row items-center space-x-2 sm:space-x-4">
<MainLinks />
</div>
</div>
4 changes: 2 additions & 2 deletions front/src/components/ThemeToggleButton.astro
Original file line number Diff line number Diff line change
Expand Up @@ -105,11 +105,11 @@ import { Icon } from "astro-icon/components";
@keyframes fadein {
0% {
opacity: 0;
background-color: #d8dee9;
background-color: #e5e9f0;
}
100% {
opacity: 1;
background-color: #d8dee9;
background-color: #e5e9f0;
}
}
body.fadeinlightclass {
Expand Down
2 changes: 1 addition & 1 deletion front/src/layouts/PageLayout.astro
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ const { blogComments } = Astro.props;
---

<BaseLayout {...Astro.props}>
<Header />
<Header borderVisible={true} />
<main class="max-w-screen-lg m-auto px-6 py-6 space-y-6">
<slot />
{blogComments && <BlogComments />}
Expand Down
8 changes: 5 additions & 3 deletions front/tailwind.config.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,12 @@ module.exports = {
},
colors: {
"main": "#3B4252",
"main-dark": "#D8DEE9",
"main-dark": "#E5E9F0",
"sub": "#81A1C1",
"sub-dark": "#81A1C1",
"sub-darker": "#5E81AC",
"sub-darker-dark": "#5E81AC",
"background": "#D8DEE9",
"background": "#E5E9F0",
"background-dark": "#3B4252",
"red": "#BF616A",
"orange": "#D08770",
Expand All @@ -25,7 +25,9 @@ module.exports = {
"purple": "#B48EAD",
"purple-lighter": "#C69ABE",
"blue": "#5E81AC",
},
"gray": "#D8DEE9",
"gray-dark": "#4C566A",
},
typography: (theme) => ({
DEFAULT: {
css: {
Expand Down

0 comments on commit 40400a1

Please sign in to comment.